• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

Use a default value for file in upload script

This is part of my php script.

<form action="<?=$this_script?>" method="post" enctype="multipart/form-data">
File: <input type=file name="file" size=30><br>
<input type=submit name="submit" value="Upload File"></form>
<a href="<?=$home_page?>">Return to the Home Page</a>

How can I have a default value set for the file instead of having to browse to it every time?
Grant Fullen
Grant Fullen
1 Solution
Terry WoodsIT GuruCommented:
Wouldn't it just be this?

<input type=file name="file" value="C:/directory/filename.doc" size=30>
There are no way to access the browse but you can try another way

take a look at http://www.quirksmode.org/dom/inputfile.html

Grant FullenAuthor Commented:
I tried the value= thing already and I'm pretty sure it didn't work (as in the file didn't upload).

All I can find in that link is how to change the look of it.
most browser deny to set the value= for <input type="file" ...> for security reason, obviously ..

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now