Mod-Utility Request Embed External Images locally - Posted (7757 Views)
New Member
Todd
Posts: 63
63
If this is the incorrect forum I apologize, I thought this was the best fit.
A big problem I have and probably everyone else is when forum members link to external images that disappear later on. Many topics now have red X's where the now non-existant images should have been.
I have proeders file attachment mod being used but still many members find it easier to just throw up a link to inkfrog or another image hosting company.
My idea is this. I would like an admin utility that will go through a forum at a time and detect all links to external images, all of the IMG tagged lines which are followed by http, indicative of an external image. I would like it to then get that image and place it in the users uploaded folder. The final step would be to change the line of code to point to the forum stored image.
This would be a god send for most of us. Thanks in advance.
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
New Member
Todd
Posts: 63
63
Sorry, I forgot to come back and give an update. Thanks HUWR, it's working correctly. Wonderful utility!
Posted
Starting Member
xseoer
Posts: 1
1

this is the grab and save code, and shows the simplicity of using .Net (code is C#)

Grabbing the image is simple, first we declare a byte array to store the image in
Byte[] imagearray; next we grab the image into the array using the webclient class

using (WebClient client = new WebClient())
{
imagearray = client.DownloadData(urlofimage);
}
next we just save the imagearray to disk using a filestream

using (FileStream writer = new FileStream(destinationpath + filename, FileMode.Create))
{
writer.Write(image, 0, image.Length);

}

I will post the full code for parsing the img tags and grabbing the images later

Thanx for sharing!!
I have a lovely cat named GHD.Barinclown
Posted
New Member
Todd
Posts: 63
63
Issue with Image Grabber. Image grabber breaks, actually it removes the img code when run for a second time against a post only IF that post also contains a link to an external webpage.
Update: Done testing. If there is a link to an external webpage it interferes when starting with http:// If I remove the http:// the image grabber seems to ignore it and process the post correctly.
See this post where I worked out the issue.
http://www.tycoforums.com/tyco/forum/topic.asp?TOPIC_ID=14039

CAN THIS BE FIXED?
Posted
You Must enter a message