在线FileUpload控件 [英] FileUpload control at online

查看:66
本文介绍了在线FileUpload控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户通过FileUpload在在线网站上上传文件时,如何将图像保存在在线文件夹中.


when user upload file by FileUpload at online website, so how can save image at online folder.


string filename = Path.GetFileName(FileUpload1.FileName);
             FileUpload1.SaveAs(Server.MapPath("/fileupload/" + FileUpload1.FileName ));
             lblmsg.Text = "Upload status: File uploaded!";

推荐答案

使用文件上传控件,最好的方法是将所有图片保存在文件夹中

1.在IIS中配置为虚拟目录.
2.网站文件夹中的子文件夹.
3. IIS和运行网站的当前用户可以访问的文件夹.您将必须要求管理员执行此操作.
4.群集存储上的文件夹.
Using File upload control the best way is to save all the pictures in a folder

1. that is configured as a virtual directory in IIS.
2. A sub-folder inside your website folder.
3. A folder on which the IIS and the current user with which website is running has access to. You will have to ask you admin to do that.
4. A folder on a clustered storage.


用户应该在试图上载的文件夹上具有写访问权限.
User should have write access on the folder, where you are trying to upload.


这篇关于在线FileUpload控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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