These forums are read-only and considered to be an archive. Please use the new Community for future interaction and posts.

File Upload extensions

I have a question, I need to limit the kind of file than user upload with this control, ex only .doc,.xls file etc. How can I do this?

Thanks
Juan 4/21/2008 12:36 PM
Is there anyway to limit the files to be uploaded to certain extensions as doc,xls etc...
If not can the upload button for file be disabled, or no visible then the file upload be implemented with a different control
Thanks
Juan 4/23/2008 6:52 AM
Allowing certain file types only will be available in v1.5 which is to be released soon.
Cem Alacayir 4/24/2008 6:25 AM
Cem:
Do you have any date for this release?
Can I disable the upload permission, then build a control myself?
When I do this 

rootFolder.RemovePermissions = FileVistaPermissions.Upload;

I get this error...

Cannot assign to 'RemovePermissions' because it is a 'method group'

Thanks

Juan 4/24/2008 6:55 AM
I get this error when I try to use version 1.5


Error    2    The name 'InsertAllowedFileTypes' does not exist in the current context    c:\inetpub\wwwroot\InvestorsOnly2008\FileVistaControl\upload.aspx    16    
Thanks
Juan 5/6/2008 8:05 AM
RemovePermissions is a method so you can not assign a value, you should use it instead as

rootFolder.RemovePermissions(FileVistaPermissions.Upload);

You are getting the other error because the old DLLs of the control are still active. Please clean and re-build your project in Visual Studio. Check if the DLLs in your project's bin folder are refreshed.
Cem Alacayir 5/6/2008 9:26 AM
Thank you Cem, it compiled fine. How do I limit the type of file to be uploaded?

Thanks
Juan 5/6/2008 10:48 AM
You can limit the type of files to be uploaded by setting the new property AllowedFileTypes to a list of semi-colon separated extensions:

rootFolder.AllowedFileTypes = "*.jpg; *.doc"
Cem Alacayir 5/6/2008 2:48 PM