Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 22nd Jul 2013, 04:14 AM   #1
www.ecomstarterpack.com
 
techwizard's Avatar
 
Join Date: 2013
Location: France
Posts: 249
Thanks: 48
Thanked 49 Times in 43 Posts
Default
Whats the best way to store images in php?
Share on: 
fb share twitter share gplus share more share

I want to store images on the server using php script, I want to know which way is better to store images using php?

Thanks in advance,
techwizard is offline  
Unread 22nd Jul 2013, 04:16 AM   #2
Active Warrior
 
skillboyz's Avatar
 
Join Date: 2013
Location: AU
Posts: 57
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: Whats the best way to store images in php?
Share on: 
fb share twitter share gplus share more share

There are two ways to store images on the server either using blob data type in mysql and by uploading to the folder and store path in mysql database
skillboyz is offline  
Unread 22nd Jul 2013, 07:07 AM   #3
SKT Wordpress Themes
War Room Member
 
sktthemes's Avatar
 
Join Date: 2013
Location: Nagpur
Posts: 65
Thanks: 5
Thanked 28 Times in 11 Posts
Default
Re: Whats the best way to store images in php?
Share on: 
fb share twitter share gplus share more share

Hello,
Their are two things needs to do for storing images on server
1) Store image file name in mysql table
2) create one folder 'upload' on server and move image in it

move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]);

sktthemes is offline  
Unread 25th Jul 2013, 09:02 PM   #4
Warrior Member
 
Join Date: 2011
Location: Dhaka, Bangladesh
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: Whats the best way to store images in php?
Share on: 
fb share twitter share gplus share more share

I agree with sktthemes. It is the best way to store image. If you want to handle massive amount of image you can upload them into date based directory like
uploads/dd-mm-YYYY/
and you can also rename them unique using
uniqid
function.

kiash001 is offline  
Closed Thread


Bookmarks

Tags
images, php, store


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




All times are GMT -6. The time now is 02:40 AM.