automatically put a default filename in <input type=file...> value

L

leeaids

Hi,


I am hoping somebody can help me.
Normally to use the file upload feature in an html page, users must
either select or type in a file to upload then click on button or link
to initiate the upload. I was wondering if it were possible to put a
default file name in, then after a certain countdown, if the user has
not selected another file?

Thanks
 
S

Stefan B Rusynko

You can only put a default value in the form field value
<input type="file value="YourDefaultPathAndFilename.AndExtension">
- but what makes you think they have that file name/location/type on their PC?

--




| Hi,
|
|
| I am hoping somebody can help me.
| Normally to use the file upload feature in an html page, users must
| either select or type in a file to upload then click on button or link
| to initiate the upload. I was wondering if it were possible to put a
| default file name in, then after a certain countdown, if the user has
| not selected another file?
|
| Thanks
|
 
A

Andrew Murray

I don't believe you can use the file upload component in the way you're
asking and FP provides no other way to do so.

1) With the file upload component in FP you can't put a default name in
(that is, through the form field properties,as with other form fields) -
there's no allowance to do that.

2) Usually the user has to select the file from *their* computer - so you're
not going to know what file to use as a default, since you don't know what
files are on the user's computer, unless you have some pre-arranged
agreement that the users will save a certain word document to their my
documents folder named "joebloggs.doc" or whatever.

3) You haven't mentioned whether you're going to use this function (assuming
it can work in some way or other) in an intranet or something other than a
public web site, in which case it might be possible to know what files
people have on their machines for you to make the site come up with a
default file (i.e. on an internal network), but this is still a privacy
issue, prying into the contents of a particular user's machine....
 
L

leeaids

actually its just for internal network...
we already defind the filename and directory for the default..

i tried doing this "<input type="file
value="YourDefaultPathAndFilename.AndExtension"> "
but the filename doesn't appear on the text box...

but if you view the source, you will see that the value field already
has the "YourDefaultPathAndFilename.AndExtension" value.

any ideas?

thanks
 
T

Thomas A. Rowe

For security reasons I don't think you can do that or it you do the browser will remove it.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
K

Kevin Spencer

It's a security issue. An "input type='file" form element cannot have its
value set except by browsing.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top