473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

retain file info on page reload

107 100+
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 3560
pradeepjain
563 512MB
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 Expert 4TB
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 100+
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.doc 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 100+
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 Expert 4TB
@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
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...
1
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...
3
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....
8
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...
5
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. ...
0
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 ...
2
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
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,...

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.