Image Preview in javascript while uploading the images

Discussion in 'Javascript' started by Kumarasamy.Mani@gmail.com, Nov 22, 2005.

  1. Guest

    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
     
    , Nov 22, 2005
    #1
    1. Advertisements

  2. > 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?
     
    Joshie Surber, Nov 22, 2005
    #2
    1. Advertisements

  3. Guest

    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.
     
    , Nov 22, 2005
    #3
  4. VK Guest

    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.
     
    VK, Nov 22, 2005
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. darrel
    Replies:
    3
    Views:
    2,479
    Steve C. Orr [MVP, MCSD]
    Jul 23, 2004
  2. Dung Ping
    Replies:
    10
    Views:
    1,440
    Chaddy2222
    Jan 16, 2006
  3. =?Utf-8?B?am9l?=
    Replies:
    1
    Views:
    460
    =?Utf-8?B?TXVyYWxp?=
    Jul 21, 2006
  4. Replies:
    0
    Views:
    1,172
  5. sadegh
    Replies:
    1
    Views:
    434
    Victor Bazarov
    Aug 26, 2010
  6. 88888 Dihedral
    Replies:
    10
    Views:
    736
    Victor Bazarov
    Dec 23, 2011
  7. luciosan

    Preview image with Ruby

    luciosan, Oct 3, 2007, in forum: Ruby
    Replies:
    1
    Views:
    153
    John Joyce
    Oct 3, 2007
  8. kiran
    Replies:
    7
    Views:
    3,140
    kiran
    Nov 9, 2011
Loading...