Go Back   Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum > Support > php issues.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-02-2008, 07:42 AM
new member
 
Join Date: May 2008
Posts: 6
Default ftp functions

Im developing a photo gallery for somebody and would like to use PHP's ftp functions to allow the user to upload the images directly to the server. Im new to these functions and have read that php should be compiled at runtime with --enable-ftp (PHP 4+).

I dont totally understand this? Is this something i control or is it already set up this way with webhosting.uk

Thanks
Reply With Quote
  #2 (permalink)  
Old 05-02-2008, 08:27 AM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

Hi php is already compiled so using ftp shouldn't be a problem.
Any specific reason why you are using ftp as opposed to a html upload form?
__________________
West Dorset Community
Reply With Quote
  #3 (permalink)  
Old 05-02-2008, 08:48 AM
new member
 
Join Date: May 2008
Posts: 6
Default

There wasnt a specific reason. Ive not written any code to upload files before and am unsure of the best method. Would you recommend a HTML upload form? The user would need to be able to create a folder on the server for a particular set of photos and then upload the photos to that folder.
Reply With Quote
  #4 (permalink)  
Old 05-02-2008, 01:45 PM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

Hi I think the problem you are going to have is that it is a lot more complex than just uploading images into a folder. There is image sizes, dimensions, thumbnails to consider. How do you intend to display them?

Yes you could use either mkdir("/path/to/my/dir", 0700) or use the ftp function ftp_mkdir, either would suffice.

I would have an html form to upload the images but not sure whether i would create folders for different albums! Of course you could, and I have done that before, but I personally would use one folder and use a database to assign the images to different albums (if that makes sense)

I guess it depend how many users are going to upload images and how these images are going to be displayed, and how many different ablums there is going to be.

There is a script that I have used which is fantastic. It is a class upload script which not only resizes the uploaded images as many times as you want, so say you want the big pic to be a max of 600px width, you can also go through the process again to create a thumb. It will then destroy the original. If you want i will find the link for you!

There are plenty here to help if you have any problems!



__________________
West Dorset Community
Reply With Quote
  #5 (permalink)  
Old 05-19-2008, 05:53 PM
new member
 
Join Date: May 2008
Posts: 6
Default

Having started the project now it makes sense to use the database to group the photos into the specific albums. There is only going to be one user uploading images and possibly only a new set of photos every month or so.

Originally the user was going to resize the images prior to uploading but the class you mentioned would save on his work and would allow the gallery to display thumbnails and full size images.

If possible would you be able to forward the link for the class upload script?

Thanks again
Reply With Quote
  #6 (permalink)  
Old 05-20-2008, 07:15 AM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

Hi, link below
http://www.verot.net/php_class_uploa...e3d2959f19847b
__________________
West Dorset Community
Reply With Quote
  #7 (permalink)  
Old 05-23-2008, 01:49 PM
black-dog's Avatar
Member
 
Join Date: May 2008
Location: Newcastle under Lyme
Posts: 54
Send a message via Yahoo to black-dog
Default

Quote:
Originally Posted by jon123 View Post
I personally would use one folder and use a database to assign the images to different albums
I'd do that too but that requires some knowledge of databases and normalisation. It has the advantage that you can store additional information about each album. in a structured way.

Some people advocate storing the images in the database. I never have but can accept some of the arguments for it.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:04 AM.
Copyright 2002-2007 WebHosting.uk.com. All rights reserved.
Web Hosting UK Forum