954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Upload image using PHP and AJAX

Hi this is scorpionz
Any response will be appreciated with great interest,
can anyone have an idea regarding image upload through PHP+Ajax, i m using mysql as a db.
Like the Process i want to do is that:
I have create a field of image_name in DB table and just storing a name of image,

now when i press Button of Upload
It Should not refresh page and save image name to DB and load that image to folder that created at server side in Project folder

Anyone have any idea regarding how to do that with Ajax and PHP?
I will be thankful

Regards
scorpionz

scorpionz
Junior Poster
109 posts since Sep 2006
Reputation Points: 13
Solved Threads: 0
 

I don“t know ajax, but I did the same with any file to upload. I had to upload some things to my server and I want to use the php for this.
I made an index.php with form creation and an upload.php what uploads the file.
In the web directory I created directory called data with 777 access rights and upload everithing in this directory.

slacke
Junior Poster
106 posts since Jun 2006
Reputation Points: 14
Solved Threads: 7
 

i'll write some code and see if i can get it to work. (i'm curious). i will let you know of the results.

kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194
 

use this site i found:

http://www.openjs.com/articles/ajax/ajax_file_upload/

it has the info you need

kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194
 

Hi i am back...after a long vacations
Now first of all Thanks a lot to "slacke" and "kkeith29" for responding to my started thread.

To slacke,
Well Mr.slacke, no problem, if you have no idea, regarding my started thread, may be the knowledge that i will share here will might helps you so....

To kkeith29,
Well Mr.kkeith29 thanks for providing this Web refernce , but according to my opinion, i dont think so it is an Ajax,.....
Because, the browser loading bar is stil running and i think frommy point of view, iframe is not an good practice to run with Ajax...
What is your opinion regarding this?
and this web reference, I am cofused to apply...
Any other reference or guide lines will be appreciated with reat interest....

Regards
Scorpionz

scorpionz
Junior Poster
109 posts since Sep 2006
Reputation Points: 13
Solved Threads: 0
 

i have done this using framset and php code no needed ajax code. i ll send you the code soon but still need some modifications. uploading and db part works fine.

fatihpiristine
Posting Whiz in Training
283 posts since Sep 2007
Reputation Points: 6
Solved Threads: 19
 

Thanks for Response back fatihpiristine

Yes Sure
I am waiting to see that...
When will u?

Regards
Scorpionz

scorpionz
Junior Poster
109 posts since Sep 2006
Reputation Points: 13
Solved Threads: 0
 

Galeri Resimleri
Yuklemek istediginiz resim dosyasini secin; sadece JPEG, GIF ve PNG dosyalari


Resimleri goruntulemek icin uzerine tiklayin <?php for ($i = 0; $i < $ImageNo; $i++) { ?> <?php if($Gallery[$i] == '') { echo $NoP <?php if($Gallery[$i] != '') { print "Sil"; } ?> <?php } ?> <?php print_r($Gallery); ?>

fatihpiristine
Posting Whiz in Training
283 posts since Sep 2007
Reputation Points: 6
Solved Threads: 19
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You