使用输入类型文件上传图像 [英] image upload with input type file

查看:49
本文介绍了使用输入类型文件上传图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




i有输入类型=文件,用于选择图像并保存在我的用户自定义文件夹中...



我也从jquery(追加)添加新的输入类型文件...并使用相同的程序保存在文件夹中..



但如果我保存使用asp.net的file.copy或file.move,它给出错误







无法使用找到文件'C:\Program Files(x86)\ Microsoft Visual Studio 9.0 \ Common7 \IDE\thumb9.jpg'。





我从图片夹中选择了thumb9.jpg并想保存为



Hi
i have input type="file" which i use to select image and save in my user defined folder...

also i add new input type file from jquery (append) ...and use same procedure to save in folder..

but if i save using asp.net's file.copy or file.move, it gives error as



Could not find file 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\thumb9.jpg'.


I selected from image thumb9.jpg from folder and want to save as

dayimagenew = Request.Files[DayImage1].FileName;
                   File.Move(dayimagenew, "D://SelImg/Test.jpg");







但上面给出错误




but the above is giving error

推荐答案

你也应该传递带有fileName的完整路径以及源的File.Move方法。



检查这个以获得参考



Refer [ ^ ]
You should pass the full path with the fileName as well in the File.Move method for the source too.

Check this for a reference

Refer[^]


这篇关于使用输入类型文件上传图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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