?
Solved

Copy file from URL to my webserver

Posted on 2006-11-25
6
Medium Priority
?
256 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Assisted Solution

by:jalalmegadeth
jalalmegadeth earned 1050 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 28

Accepted Solution

by:
FishMonger earned 450 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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

770 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