类库项目中的FileUpload [英] FileUpload in Class Library Project

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

问题描述

大家好,
我正在使用Visual Studio2008.我的主要目标是在.NET中创建一个dll,该dll将在经典ASP中注册并用于上载文件.假定dll是从客户端获取文件路径,而从应用程序获取物理路径(比如说硬编码),以便将文件上传到运行ASP页的服务器上.
我不知道如何在类库项目中使用FileUpload对象,以及如何为该FileUpload对象分配文件和路径,以便将文件上传到指定的某个位置.有什么主意吗?
在此先感谢.
问候,
ABSIALS

Hi All,
I am using Visual Studio 2008. My primary objective is to make a dll in .NET that would be registered and used in classical ASP to upload the files. The dll is assumed to get the file path from client and physical path from the application (let''s say hard-coded) to upload the file at server at which the ASP pages are running.
I have no idea how to use the FileUpload object in the Class Library project and how to assign the file and path to this FileUpload object in order to upload the file at some location specified. Any idea?
Thanks in Advance.
Regards,
ABSIALS

推荐答案

写道:​​

假定该dll是从以下位置获取文件路径客户端和应用程序的物理路径(假设是硬编码)以将文件上传到运行ASP页的服务器上.

The dll is assumed to get the file path from client and physical path from the application (let''s say hard-coded) to upload the file at server at which the ASP pages are running.



然后,您需要编写一个ActiveX控件,而不是在服务器端提供代码的dll.您不能将ASP.NET FileUpload对象嵌入到ASP网页中.但是,它只是带有文件类型的输入标签,因此,如果您陷入经典的ASP开发地狱中,就可以使用ASP进行操作.



Then you need to write an ActiveX control, not a dll that provides code on the server side. You cannot embed an ASP.NET FileUpload object into an ASP web page. However, it''s just an input tag with the type of file, so you can just do it using ASP, if you''re trapped in the hell that is classic ASP development.

写道:​​

如何为此FileUpload对象分配文件和路径

how to assign the file and path to this FileUpload object i



无法在客户端设置文件上传/输入文件标签的外部设置文件路径.这是出于安全目的.



There is no way to set the file path of a fileupload/input file tag outside of the client setting it. This is for security purposes.


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

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