Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
sir,

In my Project i upload an image but i wants when clients don't wants to upload an image then its select an blank image from specified folder.

How is possible, please help me out its urgent.

Regards
Nandita
Posted
Updated 29-Feb-12 21:35pm
Comments
V. 1-Mar-12 3:24am    
Can you give us more info on 'why' you want this behaviour? Also, is this a web application or an winforms? Forcing a user to do use a dummy for anything is usually bad practice and re-designing might be something to consider.

1 solution

I think if client does not want to upload an Image then you should return some proper message. But any way if you want to send an empty image then just create a file 1.jpg in specified folder and upload it. You can use below given code for creating dummy image file

C#
using (System.IO.FileStream fs = System.IO.File.Create("c:\\dummy.jpg"))
{
    fs.Close();
}
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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