LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 August 7 2014

Ramii
Member

Upload a picture through PHP/MySQL

Hello

i am working on a small application, the user must insert some date and upload a photo. i am new on php and web applications. So how can i do it ?

-The user will fill some text field and choose the destination of the JPEG photo and then click on submit.

Thank you guys.

Offline

#2 August 7 2014

Cpt.Majed
Member

Re: Upload a picture through PHP/MySQL

When it comes to images, you can store them in the database as a BLOB type(putting the actual image in the database) or store them in a folder and put the path in the database.

This is one of the best tutorials out there because it's simple and clean :
Step by step tutorial

This one is for BLOB uploads
Photo Upload using BLOB

If you need any help let me know :)

Offline

#3 August 7 2014

Ramii
Member

Re: Upload a picture through PHP/MySQL

Cpt.Majed wrote:

When it comes to images, you can store them in the database as a BLOB type(putting the actual image in the database) or store them in a folder and put the path in the database.

This is one of the best tutorials out there because it's simple and clean :
Step by step tutorial

This one is for BLOB uploads
Photo Upload using BLOB

If you need any help let me know :)


thank you bro :)

Offline

#4 August 7 2014

rtp
Member

Re: Upload a picture through PHP/MySQL

Do not store the image in the database instead, upload the image to the server directory and save the image name inside the database.
So the table will contain a varchar(MAX) and in it you will save the name of the image "avatar_1.jpg".

http://www.w3schools.com/php/php_file_upload.asp

Offline

#5 August 7 2014

Joe
Member

Re: Upload a picture through PHP/MySQL

There are better choices than storing the files to disk on the server. A far more flexible option is to use an object store, like Amazon S3 or Rackspace Cloud Files. It provides a more flexible and a LOT more reliable way than just assuming that your server's disk won't ever crash.

Offline

#6 August 7 2014

rtp
Member

Re: Upload a picture through PHP/MySQL

rahmu wrote:

There are better choices than storing the files to disk on the server. A far more flexible option is to use an object store, like Amazon S3 or Rackspace Cloud Files. It provides a more flexible and a LOT more reliable way than just assuming that your server's disk won't ever crash.

Thanks for the share :)

Offline

#7 August 8 2014

Ramii
Member

Re: Upload a picture through PHP/MySQL

thank you guys :) !!

Offline

Board footer