Image Preview in javascript while uploading the images

  • Follow


Hi all,

I'm having the following issue in image preview.

I'm having an File Upload option in my web page, there i'm having one
more option preview. When the user is uploading the image using the
input box, i need to show preview of the image. When i'm using in MSIE
it's working fine but in Netscape Browser's it's not working at all.
This is my logic in Javascript

function changeImg() {

document.getElementById("imgPreview").src =
document.UploadForm.uploadFile.value

}

This is not working in Netscape Browsers. My Suspect is there is
problem in the path. When this logic is in Local machine it's working
fine. When im putting in my server it's not working fine from local
machine

Thanks in Advance
Kumarasamy.M

0
Reply Kumarasamy.Mani (3) 11/22/2005 5:05:42 AM

> document.UploadForm.uploadFile.value

I don't believe Gecko lets you script the values of a upload widget.
Security restrictions and all. I may be wrong though, perhaps someone
else knows better than I?

0
Reply Joshie 11/22/2005 9:37:23 AM


Joshie Surber wrote:

> > document.UploadForm.uploadFile.value
>
> I don't believe Gecko lets you script the values of a upload widget.
> Security restrictions and all. I may be wrong though, perhaps someone
> else knows better than I?

Any way i'm not altering any values of file upload controls. I'm taking
the values and changing the image tag's src value. I think that's not a
problem.

-1
Reply Kumarasamy 11/22/2005 2:19:09 PM

Kumarasamy.Mani@gmail.com wrote:
> Any way i'm not altering any values of file upload controls. I'm taking
> the values and changing the image tag's src value. I think that's not a
> problem.

You are linking a system resource (and any local file is a system
resource) to the page loaded from the Internet. You cannot do it in the
standard security environment.

-1
Reply VK 11/22/2005 2:35:18 PM

3 Replies
525 Views

(page loaded in 0.141 seconds)

Similiar Articles:













7/25/2012 3:57:32 PM


Reply: