不使用Fileupload控件如何将文件从客户端发送到服务器 [英] without using Fileupload control how to send file from client to server

查看:74
本文介绍了不使用Fileupload控件如何将文件从客户端发送到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在不使用文件上传控制的情况下将文件从客户端计算机发送到服务器.实际上,我不想手动选择文件并将其上传到服务器.文件路径在代码中给出.

I want to send file from client machine to server without using file upload control.Actually i don''t want to select file manually and uploaded to server.File path is given in code.

推荐答案

您不能只是去获取客户端计算机的文件,否则将无法正常工作.
您将必须具备:
-FileUpload控件,用户可以在其中选择文件.或
-在客户端上安装的ActiveX以发送文件.或
-在客户端上运行的exe发送文件.
浏览器与客户端计算机无关.他不了解客户端计算机的文件夹结构/文件系统.

但是您可以使用Javascript获取客户端计算机文件,然后使用
将其发送到服务器 File.Copy()
You can''t just go and take a file of the client machine, it doesn''t work that way.
You will have to have:
- FileUpload control, where the user selects the file. Or
- An ActiveX installed on the client to send the file. Or
- An exe running on the client to send the file.
browser has nothing to do with client machine. he don''t have a knowledge of client machine folder structure / file system.

but you can use Javascript to get client machine file and send it to server using
File.Copy()


这篇关于不使用Fileupload控件如何将文件从客户端发送到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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