Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Extracting image from email
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Extracting image from email

 Post Reply Post Reply Page  12>
Author
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Topic: Extracting image from email
    Posted: 21 August 2003 at 8:56pm
I'm trying to save myself some time by writing a script that adds comics to my database for me. The only problem is that all the comic <img src=... tags are located in emails. Just to add to the headache, the emails have ads of varying lengths, so that rules out a goto line type function. Also, there is more than one <img src... tag. Any Ideas (If you want the email soure i'll post it, it's quite lengthy...)
Back to Top
Phat View Drop Down
Senior Member
Senior Member


Joined: 23 February 2003
Status: Offline
Points: 386
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phat Quote  Post ReplyReply Direct Link To This Post Posted: 21 August 2003 at 9:51pm
Does the comic always have a certain type of name?
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2003 at 8:22am
The comic image tag reads "<IMG SRC="http://www.funnymail.com/webdata/cs/20030502.gif">". Notice that the numbers in the filename are the date. The rest stays the same.
Back to Top
Phat View Drop Down
Senior Member
Senior Member


Joined: 23 February 2003
Status: Offline
Points: 386
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phat Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2003 at 9:10am

You can then extract all the image tags and from there narrow it down to todays date.

I did a similar type of thing for a web page in VB.

Not sure if ASP has it but use Instr() to find <IMG SRC= then move through the text until you find the ">" tag then you will be left with the img path.

Each time you find a pic you will need to remove that part of the text so next time Instr() will find a new pic.

 

Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2003 at 9:19am
now just to add a new problem. I want to download that picture and save it onto my computer, and add it to a database. I got the second part i just need to know how to download the picture.
Back to Top
Phat View Drop Down
Senior Member
Senior Member


Joined: 23 February 2003
Status: Offline
Points: 386
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phat Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2003 at 4:31pm

You may be able to use file system to save as xxx.xxx on your hard drive. This will only work if the email is on your hard drive already. Then save the path to the file in your db not the pic.

Are you doing this in VB or ASP?
Where is the email source remote or local?

Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2003 at 5:48pm
I'm coding in ASP. I've finally got the search to work! It finds all the image sources without problem. The email source is on my local harddrive. I think i should go and search for a component or something that downloads stuff from the internet.
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 23 August 2003 at 3:50am

You already have one that should do the trick, do a google for 'microsoft xmlhttp' Use that to get the data and filesystem object to save it on your hdisk.

Mart.

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.