Downloading Images via THTTPCli  (FPiette)

Posted on 2003-03-14
Medium Priority
Last Modified: 2010-05-18
Ive got a question; Im trying to make a program that
can search and show images from internet.

This works for the biggest part, but for some reason some images
from specific server return either a 404 page or an 'unauthorised' image.

Ive tried the following code to create the instance (in a thread)

  Fhttp := THttpCli.Create(nil);
  Fhttp.MultiThreaded := True;
  FHttp.Reference := HTTPReferer;
  FHttp.Sender := HTTPReferer;
  FHttp.Agent := 'Mozilla/2.0 (compatible; MSIE 3.02; Update a; AOL 3.0; Windows 95) ';
  if fileexists(HTTPfileName) then deleteFile(HTTPfileName);
  Self.Fhttp.RcvdStream := TFileStream.Create(HTTPfileName, fmCreate);

Where the referer is the 'normal' calling page of the image. Im not sure what Sender is
with THttpCli.

Im I missing some headers or something ?
Any help would be great!

Question by:MariusX
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

Expert Comment

ID: 8136152

Are you using the absolute latest version of FPiette's Suite?

Do you belong to TWSocket elist: A forum for Q's of this type.

Here are some of the rules:
To all subscribers:

1) Please do not use HTML or RTF messages in the list. Use only plain/text
    messages (by default Outlook uses HTML ! You must change the setting).
    When replying, be sure to use plain/text. If someone email to list
    accidently NOT in plain text and if you reply to it, do take care you
    reply in plain text
2) Please do not include VCF to your messages.
3) Stay on topic ! Do not post off-topic messages and do not answer
    off-topic messages.
4) Always use a subject and change message subject when required. Do not
    change subject when not needed because message thread is lost.
    Always mention which component you talk about and OS version.
5) Do not attach files to your messages. If you have something to give, just
    tell us in the list. Interested people will contact you to get the file.
6) Post messages using the EMail address you used to subscribe.
    No alias allowed. If you use an alias, your message will not appears in
    the list.
7) If you change message subject please dont hit 'reply', but compose a
    new message. Some mail readers group messages per ID instead
    of subject.
8) Do not forget to send your registration postcard :-)

Have you asked this Q on this topic to elist?

As for your particular Q here there are some websites that recognize what browser,(IE or Netscape) if any you are using. Some refuse if not a recognized browser.

Is this your programming creation?
Have you tested this particular site with one of the test models in the ICS package. Do you have all the various parts included?(I see some of the items in your Q belong in the HTTPprot unit)


Expert Comment

ID: 8136293
Hi D3!

Ive figured it out in the meantime, basicly I had my referrer wrong.
This was because I build it from a one threaded application to a multithreaded one, which messed up the sequence of the referrer.

The app works fine now, and all images are loaded properly.

Ive made this little proggie yeah, but just starting it up. Basicly it'll become a gallery html stripper, which will download all galleries and images it finds.
The main plan is creating an indexing program for massive gallery stuff, mainly for work, because a client wants to categorize its images.


Expert Comment

ID: 9316781
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Accepted Solution

modulo earned 0 total points
ID: 10639909
PAQed - no points refunded (of 75)

Community Support Moderator

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month12 days, 14 hours left to enroll

777 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