Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

file upload without using FileUpload control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith G Hicks - 03 Mar 2008 23:03 GMT
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
bruce barker - 04 Mar 2008 00:17 GMT
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)

> 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
[quoted text clipped - 8 lines]
>
> Keith
siccolo - 04 Mar 2008 19:43 GMT
On Mar 3, 7:17 pm, bruce barker
<brucebar...@discussions.microsoft.com> wrote:
> 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
[quoted text clipped - 24 lines]
>
> - 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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.