The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
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.
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.
Last edited by Todd on 21 February 2010, 14:10
Posted
are you able to use .net on your web server? I already have some code in .net that would do this with a little tinkerring, and is a lot easier to do in .net than classic ASP
Posted
Thanks for the response. I'm not sure how to answer your question so I will tell you what I do and do not have.
The server is running Windows 2003 Server with SP2. The .Net Framework for versions 2, 3 and 3.5 are installed, all are at the latest service pack. I am using IIS and ASP.Net v2.0.50707 is installed.
I do not have any .net developer tools installed.
What do I need if anything? In short, to answer your question are you able to use .net on your web server? I will do whatever it takes to make this work.
Also to get another question out of the way, does your code do this for the entire forum at one shot or can I narrow it down to individual forums? I would then set up a test forum to test and troubleshoot it. I would be hesitant to try this out against 5 years worth of work.
The server is running Windows 2003 Server with SP2. The .Net Framework for versions 2, 3 and 3.5 are installed, all are at the latest service pack. I am using IIS and ASP.Net v2.0.50707 is installed.
I do not have any .net developer tools installed.
What do I need if anything? In short, to answer your question are you able to use .net on your web server? I will do whatever it takes to make this work.
Also to get another question out of the way, does your code do this for the entire forum at one shot or can I narrow it down to individual forums? I would then set up a test forum to test and troubleshoot it. I would be hesitant to try this out against 5 years worth of work.
Last edited by Todd on 15 February 2010, 23:26
Posted
Hi,
i would be intreasted in this code you have HuwR, Sounds like it will come in handy with a gallery project im working on.
do you mind sharing it?
Thanks
MaD2ko0l
i would be intreasted in this code you have HuwR, Sounds like it will come in handy with a gallery project im working on.
do you mind sharing it?
Thanks
MaD2ko0l
© 1999-2010 MaD2ko0l
Posted
Todd, all you need is the .net frameworks installed, I will try and throw something together over the weekend, bit pushed for time in the evenings at the moment, but hassle me after the weekend if you haven't heard anything.(I will make it work on individual forumsas it could take a while to do a whole Forum in one go)
maD2ko0l, sure no problem I will post the code next week, do you want the raw grab and save code or the finished code I will make for Todd ?
maD2ko0l, sure no problem I will post the code next week, do you want the raw grab and save code or the finished code I will make for Todd ?
Posted
Thank you so much HuwR!.. Whenever it's ready is fine, no rush. I will keep checking here. Do you need my contact information?
Posted
the raw grab and save code would be great if you dont mind.
thanks very much
thanks very much
© 1999-2010 MaD2ko0l
Posted
Originally posted by MaD2ko0l
the raw grab and save code would be great if you dont mind.
thanks very much
Actually both would be great. Looking at the 2 I'm sure there's a lot I can learn.
Posted
Originally posted by MaD2ko0l
the raw grab and save code would be great if you dont mind.
thanks very much
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
Posted
Todd, what database do you use ?
what would you like it to do if it fails to retreive the image ?
what would you like it to do if it fails to retreive the image ?
Posted
Originally posted by HuwR
Todd, what database do you use ?
what would you like it to do if it fails to retreive the image ?
I'm using an Access 2000 database.
If it were to fail to get the image I would imagine you are referring to when that particular image has already "diappeared" from it's externally hosted site. Maybe it would be good to replace that with a generic image called PleaseFixLink.jpg That could be an image that all snitz forum admins can decide they want it to be. Thinking about this more that would mean we would be changing the link to point to that generic image thus losing the original non working link.
Ideas?
Maybe just logging the poster name, forum/topic and missing image link? I could then PM the user's asking them to fix it. The next time I run the utility it could pick up the image.
Email Member
Message Member
Post Moderation
FileUpload
If you're having problems uploading, try choosing a smaller image.
Preview post
Send Topic
Loading...