file upload without using FileUpload control


K

Keith G Hicks

I need a way to let my users browse for a file but I do not want to use the
asp.net 2.0 FileUpload control. I want to put a button and a textbox on a
page, and then click the button to open the file browse window. I'd like to
set it up like I can in VBA to allow only certain file types. I'm guessing
then I can create a FileUpload instance in code and use the properties and
methods associated with that to handle things like ContentType and FileSize,
etc. I've searched online but everything I find refers to the FileUpload
control. Anyone have any suggestiosn on where to look for help?

THanks,

Keith
 
Ad

Advertisements

B

bruce barker

the file upload just generates the html <input type=file>, which is the only
supported way for a browser to upload a file. if you want a different
behavior, you would need to write an active/x control and get you users to
install it.

some browsers (not IE) support the w3c accept attribute which would allow
specifying the allowable mime types.

the browse is implemented by the bowser, and the only attibute that client
script can look at is the filename, no size or mimetype (though you coul
maybel derive this from the extension).

-- bruce (sqlwork.com)
 
S

siccolo

the file upload just generates the html <input type=file>, which is the only
supported way for a browser to upload a file. if you want a different
behavior, you would need to write an active/x control and get you users to
install it.

some browsers (not IE) support the w3c accept attribute which would allow
specifying the allowable mime types.

the browse is implemented by the bowser, and the only attibute that client
script can look at is the filename, no size or mimetype (though you coul
maybel derive this from the extension).

-- bruce (sqlwork.com)





- Show quoted text -

you can try to experiment with Scripting.FileSystemObject and
javascript ...
see my article at Custom File Upload at
http://www.siccolo.com/Articles/CodeProject/UploadControl_Javascript/...

...more at http://www.siccolo.com/articles.asp
 
Ad

Advertisements


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

Similar Threads


Top