How to upload a file to my webserver from another url?
-
I know how to upload a file from my local disk to the webserver, but how would I pass in a URL of a file located on a webserver instead of my local drive? In other words I want to be able to pass in "http://www.example.com/fileName.xyz" and have fileName.xyz upload to a location I want on my webserver. I was having trouble finding the right keywords to ask google :) Has anyone done this before?
-
I know how to upload a file from my local disk to the webserver, but how would I pass in a URL of a file located on a webserver instead of my local drive? In other words I want to be able to pass in "http://www.example.com/fileName.xyz" and have fileName.xyz upload to a location I want on my webserver. I was having trouble finding the right keywords to ask google :) Has anyone done this before?
You can't do that, unless the file itself is both visible in your web server, and your web server will serve it, when requested. A better approach, would be to use web services to pass the file around, if you have access to both ends of the equation.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
You can't do that, unless the file itself is both visible in your web server, and your web server will serve it, when requested. A better approach, would be to use web services to pass the file around, if you have access to both ends of the equation.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
There must be a way of (it doesn't have to be via the file upload control) passing the url of a file to your program and having it download the file to a specific location on the web server.
-
There must be a way of (it doesn't have to be via the file upload control) passing the url of a file to your program and having it download the file to a specific location on the web server.
Ok I think this should work. I haven't had a moment to check it yet though. If I am iterating through a series of these will this wait for the download to complete?
WebClient wc = new WebClient(); wc.DownloadFile("http://www.example.com/exampleImage.jpg", Server.MapPath("images"));
-
I know how to upload a file from my local disk to the webserver, but how would I pass in a URL of a file located on a webserver instead of my local drive? In other words I want to be able to pass in "http://www.example.com/fileName.xyz" and have fileName.xyz upload to a location I want on my webserver. I was having trouble finding the right keywords to ask google :) Has anyone done this before?
hi, you have to access(read and write) tht file and save it in your web server. you have to use file concepts for this purpose. all the best
Sathesh Pandian
-
hi, you have to access(read and write) tht file and save it in your web server. you have to use file concepts for this purpose. all the best
Sathesh Pandian
I got it working using my example above. Thanks for the advice everyone.