tags:

views:

23

answers:

1

I am working on a bug fixing for a old asp web page. In this page, there is one field as file for user to browse a file for update. Here is what is like in the asp page:

<input type="file" name="ufile" size="50">

In the browser, this field looks like a text field and a "Browse" button. When use click on another submit button, the input field "ufile" is used for gettting file name for uploading. The asp file has a customized clsMyQuest.asp page to get query string or object. However it looks like broken when the asp project is moved from Windows server to a Linux server.

I don't want to spend time to fix the problem of clsMyQuest.asp file. Is there any way to get the file name in asp for this field "ufile". I guess that the value of this field should be an object of file or something. This object should be retrievable from Request and then the file name may be property of the object. For example, if the user click on "Browse" button to get a file like "C:\Documents and Settings\Documents\user1\example file.pdf", how can I get the file name "example file.pdf"?

A: 

If you're using the ASPUpload server component then you can access it by File.FileName

I assume you are running ASP on Mono, since it's a Linux server. You'll need to install the ASPUpload server component. From what i've heard it's tricky to get the component working on Linux http://www.aspupload.com/

Ed B
actually, in the asp, the "ufile" field can be retrieved and it is in binary as data. The only difference is that filename of this data is actually the file name in Linux without path, however, in Windows, the filename contains the full path with file name.
David.Chu.ca