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.
retain file info on page reload
Collapse
X
-
-
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.Comment
-
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.aComment
-
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.Comment
-
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.Comment
Comment