| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read | ![]() |
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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.
|
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
Hi, link below
http://www.verot.net/php_class_uploa...e3d2959f19847b
__________________
West Dorset Community |
![]() |
| Thread Tools | |
| Display Modes | |
|
|