Reply
Image uploading with Ajax without page refresh
Old 02-02-2008, 01:36 PM Image uploading with Ajax without page refresh
Junior Talker

Posts: 2
Name: Md. Rezwanul Haque
Good day to all.

I am designing a website with ajax and php. My main target is doing everything without full page refresh. I have done everything completed. But in the admin sector Image upload was not possible using ajax.

I solved it partially using IFRAME. It does well in IE. But in FF I am facing problem. Please please suggest me if any one of u have any kind of solution. I shall be ever grateful to you.

Thanx.
shiplu is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 02-02-2008, 01:39 PM Re: Image uploading with Ajax without page refresh
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
The best way is to give your image an id and then switch it, something like this:
Code:
document.getElementById("your-image").src ="your new image";
...
Code:
<img src="your old image" width="..." height="..." alt="Old Image" id="your-image" />
http://www.devguru.com/Technologies/...ref/image.html <--- all the image properties you'll need.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 02-02-2008, 01:54 PM Re: Image uploading with Ajax without page refresh
Junior Talker

Posts: 2
Name: Md. Rezwanul Haque
Thanx Adam for your quick response.

But that is not my problem. I want to upload a file/image from <input type='file'> and an image file from client side will be uploaded to the server with ajax but there will be no full page refresh.
shiplu is offline
Reply With Quote
View Public Profile
 
Old 02-02-2008, 09:08 PM Re: Image uploading with Ajax without page refresh
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 984
Name: Jeremy Miller
Location: Reno, NV
You can't do that w/ Ajax. Instead, upload it to a hidden iframe and then use Ajax to ping your main script to check on the status of the upload. The script I use for this is at http://www.seemysites.net/projFolder/uploader/ , but it requires Perl and PHP.
__________________
Jeremy Miller - TeraTask Technologies, LLC
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to Image uploading with Ajax without page refresh
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12135 seconds with 12 queries