Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to copy a file from user machine

Status
Not open for further replies.

rlals

Programmer
Jun 23, 2003
29
Is it possible to copy a file from user machine to server using ASP ?

If so, can someone point me at some documentation I can use.

Thank you.
 
No, but you can make a form that will allow users to choose a file to be uploaded.
 
If you want to choose the file to upload then search this site and/or google with the phrase "Pure ASP Upload
 
not possible with user intervention...if the user intervention is acceptable then there are lot of third party asp upload tools that you can use...

-DNG
 

Let me tell more about my question.

I have server-one that is my Asp server, and I have my server-two that is my file server.
I want that a asp running in server-one get the file from user machine e put this one on server-two.
Just copy. It´s to use on intranet (local-area)

I now that I can use Activex to do this but, some user use FireFox. :(


Thanks
Ricardo
 
Using ActiveX isn't really an ASP solution, its a browser-based solution because the ActiveX object is hosted on the client's machine in the browser.

Active Server Pages run only on the server, and in an HTTP exchange the server has basic zero control over the browser client. Sure you can send a Redirect, but that is really just a suggestion that the browser needs to request a different page, the browser could disregard the suggestion... just like it can disregard cookies, ActiveX objects, client-side script, popups, etc..

For security purposes this upload is something that the user should actively CHOOSE to do... you don't want to rely on the browser security settings being so permissive as to allow automatic uploads.
 
You would have to have the user upload the file via a web form which is not terribly difficult and can be done by following Sheco's advice above and looking for Pure ASP Upload.

The next step would be to copy the file from the web server to the file server and this can get a bit more complicated as you would have to setup permissions for the IUSR_machinename account of the ASP server to be able to write the file to the specified folder. This gets to be a problem for a lot of people.

A lot depends on what you are looking to do but you could setup a job on the web server to periodically look for a file in the local folders and if found move that file to the correct folder on the file server. This can take place at the operating system level and not at the IIS level so permissions are easier to deal with.

To automatically retrieve a file from the clients machine you would have to have rights to the folder the file is stored in or the client would have to place the file somewhere for you.


Paranoid? ME?? Who wants to know????
 
I don't believe anyone has mentioned it yet, but yet another option is uploading the file directly into a database assuming you have one at your disposal. Im not sure what the SQL Server equal is, but for Oracle you'd have a column of type BLOB (Binary large object) If you happen to be using oracle, and this sounds good to you I can provide with some helpful code.
Cheers.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top