FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


upload image through PHP AND AJAX





AOP Web Development
Hello to all frihosters! i need your help... Do you have any idea or you can share to me of uploading an image file through php and ajax.

What i mean is when the user upload the page it doesn't need to upload the whole page. Once it will upload it will automatically show on the top of the file input box... If you have anything to share please give it to me thanks!
DanielXP
http://www.air4web.com/files/upload/upload-eral-segal.zip

Have a look at that one.
AOP Web Development
thanks bro. for sharing about this one.. i will try to study this one!
rohan2kool
I don't think you can do file uploads via an XHR object. You most probably will have to use an iframe and poll the server using xhr [or any ajax method] to get the status on the file relay. This was the only way i've figured out till date.. don't know if anybody else knows any workaround, but files via an XHR object is a definite no-no.
AOP Web Development
well as i have made some research about it.. they said that you will use an iframe instead of get coz you need the get the file information through $_FILES[] so you need to use iframe.. but as of now i don't have enough totally idea in implementing about this.
rohan2kool
AOP Web Development wrote:
well as i have made some research about it.. they said that you will use an iframe instead of get coz you need the get the file information through $_FILES[] so you need to use iframe.. but as of now i don't have enough totally idea in implementing about this.


that's not exactly the reason. The thing is that browsers do not allow cross-domain xhr requests meaning, if your site is xyz.com, you cannot open connections to yzx.com or something other than xyz.com. Even though it is allowed in some cases, local filesystem protocol is a strict no-no meaning you cannot open connections to say.. c:/myfile.gif or something like that [totally for security reasons]. If you could, well you could easily send files a POST request via xhr.
Related topics
Executing a .sql file through PHP
Filter File Types in PHP File Upload
PHP "worth it" question
Problem with Image upload mod from phpBBstyles
Rotate images using css?
A very good PHP MySQL Tutorial
php upload issue
image upload, and return url to image
PHP + Ajax
Upload image file problem
upload File using ajax php or IFrame
Uploading an Image using PHP script - RESOLVED
I need a solution for gallery in mootools and upload image
how to connect database through php
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.