Solved

Copy file from URL to my webserver

Posted on 2006-11-25
6
247 Views
Last Modified: 2012-05-05
A simpel question:

Say I have an URL to an image e.g. www.easyblog.dk/DSC00603.jpg. How do I "copy" that imagefile an save it on my webserver using normal ASP

- thomas
0
Comment
Question by:logicmedia
  • 3
  • 2
6 Comments
 
LVL 5

Assisted Solution

by:jalalmegadeth
jalalmegadeth earned 350 total points
ID: 18011391
0
 

Author Comment

by:logicmedia
ID: 18011760
no it's rather a download. I have a link to an image which I want to display on my page. But I do not want to refer to it in its current location. I want to copy that image to my own server from what webserver its on and save it on my own server and then display it. So you could say I want my ASP script to download a file from an URL location...
0
 
LVL 5

Expert Comment

by:jalalmegadeth
ID: 18011797
yeah it'S the same thing

an upload script can do the trick, u have just to specify the file location (local or on the internet) in your case the file is already on the internet
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 28

Accepted Solution

by:
FishMonger earned 150 total points
ID: 18012340
An upload script doesn't make sense in this case.

I don't work with ASP, but if you're open to other options, here's a perl command that will download the file.

C:\>perl -MLWP::Simple -e "getstore('http://www.easyblog.dk/DSC00603.jpg', 'DSC00603.jpg')"


Here's the same thing in script form instead of command line.

#!c:/perl/bin/perl.exe

use LWP::Simple;
getstore('http://www.easyblog.dk/DSC00603.jpg', 'DSC00603.jpg');
0
 

Author Comment

by:logicmedia
ID: 18014702
Okay I found a way... The upload thing seemed overkill and requires the use of a component on the webserver. So in my search for components on my webserver I found the aspHTTP component. It does the job easily:

      Set HttpObj = Server.CreateObject("AspHTTP.Conn")
      HttpObj.Url = arrImg(i)
      HttpObj.FollowRedirects = True
      HttpObj.RequestMethod = "GET"
      HttpObj.UserAgent = "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"
      HTTPObj.SaveFileTo = server.MapPath(filepath & filename)
      HttpObj.GetURL
      Set HttpObj = nothing

And its saved...

I'm handing out the points anyways - gonna split them.

Thanks for your time guys...

0
 
LVL 5

Expert Comment

by:jalalmegadeth
ID: 18014934
thx for points,
and thx for sharing your solution :))
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now