473,884 Members | 2,296 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

retain file info on page reload

107 New Member
i have a form via which new users can register their information along with their Resume. Now when input validation is done, if there is some errors, then the page is reloaded with the users information retained for necessary correction. In this process i find the file name and local path missing every time. So, how should we retain the local file path during page reload.
Sep 11 '09 #1
5 3592
pradeepjain
563 Contributor
try storing the file path and name in some temp variable and restore it back if errors exists!!!
Sep 11 '09 #2
Atli
5,058 Recognized Expert Expert
Hi.

I'm pretty sure it is impossible to set the vale of a <intput type=file>.
It's a security measure, to prevent malicious code from uploading files without your permission.

The user has to physically select the file. Your code is not allowed to do it.

As a workaround, you could always just store the file the first time around (I assume it gets uploaded with the data before the input validation?) and instead of the single <input> box you would normally use, tell the user that the file has already been received and to only select a file if he/she want's to change it.
Sep 11 '09 #3
raamay
107 New Member
You are right but the problem is that even if you save the file name and path in a temp variable the result is same. What i meant is that suppose you upload C:\Files\text.d oc and return result of the file name is only text.doc. Here only the filename is there with no path. So, thats what i am referring to.a
Sep 14 '09 #4
raamay
107 New Member
i have came to know from many that the procedure of retrieving the file path is not allowed in browsers(esp IE7 and above) for security reasons. But i have also often seen the path info being retained in all type of browsers. So, i am preety sure there is a way out.
Sep 14 '09 #5
Atli
5,058 Recognized Expert Expert
@raamay
There are of course client-side methods you could use to get this info. (Java, ActiveX, etc..).

But why do you need the full path?
You can't actually use it, as no decent browser will ever give you access to the local HDDs, nor allow you to set the value of a file input box.

Wouldn't it be enough to just store the file that was previously sent and let the user know that it has already been received? The file name alone would do fine for that purpose.
Sep 14 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2707
by: Pete | last post by:
Just a quick question regarding the way to do something rather than the actual code :- I have a page which has some links that go through to a HTML form and each link will check a certain checkbox. I want the form to retain the checked status of any checkboxes that are set to checked when the user goes back to the previous page. Would this be best done using sessions or is there another way I could use? I don't mind using sessions...
1
4829
by: zdhiu | last post by:
Hi javascript gurus, I have a simple html file (simple.html) with javascript. In html page there is sentence from variable defined in .js file (myFirst.js). Once I reload another .js file (mySecond.js), the value defined in the second one is NOT reloaded into html page. Please help out what's wrong in my code. BTW, I use IE6.0
3
6461
by: KathyB | last post by:
Hi, Been reading a LOT about frames, variables, etc. I realize you can NOT use server.transfer with target frames (which are client)... I have a Parent frame containing Left and Right frames. IS IT POSSIBLE (and HOW please) to do the following: 4 text controls filled in by user in Left frame, with a button click event to:
8
34695
by: Subra Mallampalli | last post by:
Hi, I am trying to use <runtime> section within the web.config file. However, the contents of the <runtime> section seem to be ignored. What am i missing here? Is <runtime> section not used by web apps? Any help is greatly appreciated. Thanks,
5
12326
by: Neil Rossi | last post by:
I have an issue with a particular ASP page on two web servers. Let's call these servers Dev1 and Beta1. Both Servers are running IIS 5, Windows 2000 SP4 with "almost" all of the latest patches. On Beta1, I am able to execute a particular page with no problem, that page opens up in the comes up just fine. On Win2kdev1, when I go to execute the same page, it opens a file download dialog and asks me whether I want to open or save the...
0
1760
by: biganimal | last post by:
I have a program and I want the program to be able to save question/answers so the program actually gets smarter without getting amnesia everytime its started. Can anyone help??? # questor.py # define some constants for futureuse kQuestion = 'question' kGuess = 'guess'
2
2894
by: ckmenon | last post by:
I have a page in which there is a drop down list.the values in drop down list are the pages.now in one page i am adding a flag which is in an external window.As soon as I save my flag and the external window gets closed, my parent page where the drop down list is present gets refreshed and the dropdown list value goes to the default value i.e. 1st value.So how to retain the value?. for eg:-4th value.
3
6397
by: sungung | last post by:
Hi group, I want to back orginal scroll postion after reload page. Is it possible? My situation is call popup windows -enter data on popup -close popup -refresh parent page -reload data. As you know, scroll position will be 0,0 after reloading page. But I want to go the postion where user click the link for popup windows.
0
9954
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10769
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10869
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10426
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9591
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7985
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7137
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6009
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.