Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



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

Posts: 2
Name: Md. Rezwanul Haque
Trades: 0
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
 
 
Register now for full access!
Old 02-02-2008, 02:39 PM Re: Image uploading with Ajax without page refresh
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 02-02-2008, 02:54 PM Re: Image uploading with Ajax without page refresh
Junior Talker

Posts: 2
Name: Md. Rezwanul Haque
Trades: 0
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, 10:08 PM Re: Image uploading with Ajax without page refresh
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
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

Please login or register to view this content. Registration is FREE
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.13156 seconds with 12 queries