Someone today asked about users uploading an image from a remote server when submitting a link. While I don’t know how to do that simply and easily, here’s what I did say about a similar method that can work.
One of the biggest issues with that is IF you’re going to be linking to an external image you have no contol over what that image is and no way to moderate it.
A user could link to a simple screenshot during submission and after approval change the image to an ad for an adult site.
Or what if the user replaced the image with a script meant to alter your site or worse, attack users. That would find your site listed on search engines as a phishing site and you’d lose all traffic.
I seriously caution you against this. Losing control of your site is not a good thing.
You can do this quite easily, but yet again, I suggest against it.
Add a new custom field as below.
Field imageurl
Text Image URL
Type TEXT
Required No
Searchable No
Permission All Users
Option (Leave Blank)
Max Image Dimension (Leave Blank)
Max File Size (Leave Blank)
Allowed File Extension (Leave Blank)
Why leave those items blank? Because IndexU cannot control those fields because you are adding this as TEXT. So how do you control it? Read on.
Add another custom field
Field imagewidth
Text Image Width
Type TEXT
Required No
Searchable No
Permission All Users
Option (Leave Blank)
Max Image Dimension (Leave Blank)
Max File Size (Leave Blank)
Allowed File Extension (Leave Blank)
And yes we need another one
Field imageheight
Text Image Height
Type TEXT
Required No
Searchable No
Permission All Users
Option (Leave Blank)
Max Image Dimension (Leave Blank)
Max File Size (Leave Blank)
Allowed File Extension (Leave Blank)
So now we have an image URL, height and width. Now we need to put them on detail_link.html (and upgrade_form.html as well)
Remove <%custom_form_field%> as this will NOT work with that enabled.
Now you simply create your link to the image as below
<img src=”<%$imageurl%>” height=”<%$imagewidth%>” width=”<%$imageheight%>” alt=”" border=”0″ />
Now with this type of system you can NOT control how big or small the images that the user links to. If they enter an image that’s 1500px by 1500px then you’re stuck with it and there’s nothing you can do.
It might just be better to force a single image size, perhaps 468×60 which is a typical banner size. This way if a user changes the image, it will display as a 468×60 image no matter what they do.
I hope you see the pitfalls of allowing something like this, which is the only reason I wrote all of it out. It’s a bad idea but yes, it’s very easy to do.









