473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Get image width and height before upload

Hi

Is it possible to somehow get the width and height of an image that is not
uploaded yet.

Ex.
<input name="upload" type="file" onchange="some javascript that sends the
width and height to a div like getElementById">
So when is click browse and finds an image it will write the width and
height in a div somewhere else on the page.

So it is before the form is submittet ?

It would also be ok if it was a button you clicked after you have browsed
you image.
It just has to be before upload..
Sep 13 '08 #1
4 3419
EnjoyNews wrote:
Is it possible to somehow get the width and height of an image that is not
uploaded yet.

Ex.
<input name="upload" type="file" onchange="some javascript that sends the
width and height to a div like getElementById">
So when is click browse and finds an image it will write the width and
height in a div somewhere else on the page.

So it is before the form is submittet ?

It would also be ok if it was a button you clicked after you have browsed
you image.
It just has to be before upload..
This is impossible due to security restrictions. The only way is to
first upload the file.

--
Bart
Sep 13 '08 #2

"Bart Van der Donck" <ba**@nijlen.comskrev i en meddelelse
news:70**********************************@e53g2000 hsa.googlegroups.com...
EnjoyNews wrote:
>Is it possible to somehow get the width and height of an image that is
not
uploaded yet.

Ex.
<input name="upload" type="file" onchange="some javascript that sends the
width and height to a div like getElementById">
So when is click browse and finds an image it will write the width and
height in a div somewhere else on the page.

So it is before the form is submittet ?

It would also be ok if it was a button you clicked after you have browsed
you image.
It just has to be before upload..

This is impossible due to security restrictions. The only way is to
first upload the file.

--
Bart
Thanks...

But how can I upload the file without submitting the form ?
Sep 13 '08 #3
EnjoyNews wrote:
...
But how can I upload the file without submitting the form ?
The form must be submitted anyhow, either by a manual action of the
user or instructed by the following javascript command:

documents.forms[0].submit()

(in case there is only one form on the page)

The file must first be manually selected by the user in any case.

--
Bart
Sep 13 '08 #4
Bart Van der Donck wrote:
* documents.forms[0].submit()
document.forms[0].submit()

--
Bart
Sep 13 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
0
by: Anonieko Ramos | last post by:
> I have a graphics images that I want to convert to > ASCII art. How do I do it? > Code: - Default.aspx.cs
6
by: Jensen bredal | last post by:
Hello gurus I need to upload to accept image upload on my site. I also need to display these images in a databound control. The image are upload in a database. My concers are: -How do i...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
2
by: Poppa Pimp | last post by:
ImageResizer.php Image Resizer PLEASE HELP The URL of the page this is on in my site is http://poppa-pimps-wallpapers.com//ImageResizer.php You can click on browse and get image,but...
4
by: yatin | last post by:
hi, friend. i have a problem in image validation plz check it. i have to include a image validation in foam 1. but i sending a details through form2. But when i include a image validation in foam1,...
7
by: mishrarajesh44 | last post by:
hii all Truly telling i hav got this code from net & i am finding error while running the code below.. code:- <?php $idir = "photo/"; // Path To Images Directory $tdir =...
10
by: mishrarajesh44 | last post by:
hii all, I am facing a problem currently.. i have a script for image uploading and resizing.. the image uploading takes place properly for every size images.. but, the resizing works for...
1
by: sravani1 | last post by:
This code runs like when i submit the form it takes the image and displayed and top of the image a map will displayed. But actually i want that when i give the image it checks the location in the map...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.