我不上传文件时如何选择空白图像 [英] How select a blank image when i am not upload a file

查看:204
本文介绍了我不上传文件时如何选择空白图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


先生,

在我的项目中,我上传一个图像,但是我希望当客户不想上传图像时,然后从指定的文件夹中选择一个空白图像.

怎么可能,请帮我紧急.

问候
Nandita

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

推荐答案

我认为,如果客户端不希望上传图像,则应该返回一些正确的消息.但是,如果要发送空图像,则可以通过任何方法在指定的文件夹中创建文件1.jpg并上传.您可以使用以下给定的代码创建虚拟图像文件

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

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


这篇关于我不上传文件时如何选择空白图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆