airnine
04-12-2004, 10:40 AM
This issue is about getting info of an image that was selected as a file via a file input field? What I am trying to do is establish the width and height of an image. This image is defined by a value in a file input field. That means I have a client browse to a file and choose it. After he's made a choice I want to get the width and height values.
Now, in IE this can be done several ways. For example one can create an image via var newImage=document.createElement('img') function, define newImage.src=fileInputFieldValue and have width and height values read from the image. For that fact you could already have an image in your document like <img src="" name="myImage" id="myImage" /> and just give src a value defined by the file input field. So all clear here.
What the problem is, this works in no other browser. I came across some security issues connected to this doing in NN, but I wasn't sure what it meant.
Anyway, I want to submit an image file with a form and along with it I'm sending image height and width values defining the size at which it will be displayed at a later time. All I want to do is show the client how big the image will actually look.
If anybody has a good suggestion, please assist. Thanks to all in advanced.
Regards, Airnine
Now, in IE this can be done several ways. For example one can create an image via var newImage=document.createElement('img') function, define newImage.src=fileInputFieldValue and have width and height values read from the image. For that fact you could already have an image in your document like <img src="" name="myImage" id="myImage" /> and just give src a value defined by the file input field. So all clear here.
What the problem is, this works in no other browser. I came across some security issues connected to this doing in NN, but I wasn't sure what it meant.
Anyway, I want to submit an image file with a form and along with it I'm sending image height and width values defining the size at which it will be displayed at a later time. All I want to do is show the client how big the image will actually look.
If anybody has a good suggestion, please assist. Thanks to all in advanced.
Regards, Airnine
