Click here to Skip to main content
15,920,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
How can I put a default value for FileUpload.
So that you do not upload a file that is uploaded default file.
Posted
Updated 19-Oct-12 21:10pm
v3
Comments
OriginalGriff 20-Oct-12 2:55am    
I'm sure English is not your native language, but it is the default language for this site.
In English, your question makes no sense at all.
Please, either try to find a better translation of your question to English, or find a site in your own native language, as they may be able to help you better than we can!
Use the "Improve question" widget to edit your question and provide better information.
javad asadi 20-Oct-12 3:26am    
You are right

So that you do not upload a file that is uploaded default file.
If you want to have a default file upload in case user fails to provide one, you can simply upload it internally in code behind. Check using FileUpload.HasFile property if anything was selected - if not, provide your default file path for upload.
 
Share this answer
 
You can't set a default file for an upload, in the sense that if they do not specify it, you will upload that file from their system - you have no access to their computer (or even any idea what the system is) from the server.

The best you can do is (as Sandeep says) check the HasFile property and if it is not true then provide a server-local value, either a null or a default image / empty file - whatever makes sense with your site.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900