Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript file upload problem

Status
Not open for further replies.

lucidtech

IS-IT--Management
Joined
Jan 17, 2005
Messages
267
Location
US
I posted this in the Coldfusion forum, but think it may be more suitable for Java.

"I am running a web-server that pulls information for a file located on the users hard-drive the parses the data and puts it into a database. I have my server set up with the standard CF upload code, and it works great. My question is this...

Is there a way for this to happen automatically. Like, once the user selects the file the first time, CF will automatically upload the file from their hard-drive to get the latest updates to the file. I've tried filling in the <cinfpunt type="file" value="#session.user_file#".....>
but CF doesn't fill in the file location. I've also tried using an input without the " type='file' " attribute, and CF won't accept it.. says it wasn't a file."

Even if I could just keep track of where the file was located the first time they used the upload form... the file is deeply embedded in the Program Files folder of the hard drive, in a folder for a game.
 
Hi

It is a security feature. Only the user can populate the [tt]file[/tt] control "by hand". Otherwise a site could get your /etc/passwd file, or what is on Windows.

Feherke.
 
best you could probably hope for is an onchange event that triggers the form's submission. try something like:

Code:
<input type="file" name="f" onchange="this.form.submit()" />



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
But the onchange event wouldn't populate the file input, would it? I'm just trying to keep my users from having to browse through their hard drive to find the file everytime they need to upload.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top