Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 28, 2006 05:14 AM by jessjing
Nov 27, 2006 03:16 PM|LINK
Hi is there any way to restrict fileupload control like upload only images or some thing like pdfs and one more imp thing is I would like to browse file from only specific directory only (like C:\Images). Is there any way to restrict like this?
Nov 27, 2006 05:02 PM|LINK
Using input file control named graphicupload
If (Not graphicupload.PostedFile
And (graphicupload.PostedFile.ContentLength > 0)
Then upload the file here....
There is also another way to check the file type, like if it's of type image. Don't have that sample with me right now.
I think it would be something like graphicupload.type
As for controling what directory the user goes to with the input file control, can't do that.
But, you can check the path they chose.
And 2.0 has thier own control now - haven't needed to use it yet:
Nov 28, 2006 01:24 AM|LINK
Hi Zath thanx for your reply, but I'm not having any idea about VB please provide me example in c#.net
Nov 28, 2006 02:56 AM|LINK
here is a sample code for you to refer to
hope it helps
Nov 28, 2006 04:13 AM|LINK
Hi thank you for your reply but I want to restrict one folder to browse. i.e. when i click browse button i should search (or upload) files from onle one specific directory or folder only (like if I press browse button i should get files from C:\myImages
folder only). Is there any way to do like this?
Nov 28, 2006 05:14 AM|LINK
it may be hard to implement it using FileUpload control, perhaps, you should find some third-part control