JoshStodola

Hi everyone,

I am in the process of creating an image upload form, and I need to display a preview of the image to the user before it gets uploaded. I did not anticipate this to be any problem, and it wasn't until I tried using it with IE7. It is not working. I know that there must be some sort of security setting (this is a ridiuclous setting, by the way) that doesnt allow for this.

Where can I find this setting so I can instruct my users how to fix it to allow the image to be previewable They will need to have this capability and there is no way around this.

With an image upload form, the user chooses the image themself. So why on earth am I not able to display it back to them They chose it!! This is the most ridiculous security precaution I have came across yet. I can understand not letting javascript have access to the file system, don't get me wrong here. But why in the heck can't I take the value of a file upload control (that is read-only) and put it as the SRC of an image Absolutely ridiculous!!

Any thoughts on the subject matter will be greatly appreciated, and I thank you in advance.

Regards,




Re: Internet Explorer Web Development IE7 displaying local images

JoshStodola

Unless anybody has a better solution, the only way I could get this to work was to have the user add this site to their trusted sites list:

Tools | Internet Options | Security Tab

Click trusted sites green checkmark and click the "Sites" button and choose Add to add the site currently being viewed.

What an unfortunate workaround






Re: Internet Explorer Web Development IE7 displaying local images

Umer

I m having the same problem that images does not show when i run the application.

I have tried by adding localhost to trusted sites and also in Local intranet trusted sites but it does not work plz help me out

Thanks






Re: Internet Explorer Web Development IE7 displaying local images

zhang_wei

if ie7 and firefox lost the feature , then we can drop the preview funcion.






Re: Internet Explorer Web Development IE7 displaying local images

robomoto

Yes, you're absolutely right. This is the stupidest thing ever. I can't preview my work because ie7 won't display local images. This is retarded. There's no clear way to resolve this in the settings. Very frustrating!





Re: Internet Explorer Web Development IE7 displaying local images

Andy Gillis

I agree this is a dumb security feature. I can find no easy workaround. It's apparently a cross-site security deal, but I cannot be 100% sure. I don't like having to ask the user to add the site to their trusted list... so I'll keep looking for a workaround.

The only thing I can think of is to actually submit the image that was browsed to. Upon submitting, capture only the image... and not the rest of the form data. (using ajax or an iframe as the form target) Save the image to a temp location on the web server. Then you can use the temp url as the src attribute value to the image just saved on the server... and that way, you can get around the cross-site security issue.

Of course, this means that you'd need to submit the form twice (once for the preview, and once for the form data). I have not yet written any code for this... sorry.

Because of this security feature change, I'm considering just stripping-out the preview feature on my webpage. The user can see the image after the form has been submitted, and make corrections if needed.





Re: Internet Explorer Web Development IE7 displaying local images

2Xpert

Hi,

Is it possible for you to post the code that helps you to preview the image

Also, kindly list down what are all the technologies you are using, say, for example, VBScript, HTML, etc...