Page 1 of 1

image upload problem

Posted: Mon May 19, 2008 3:50 am
by hannnndy
hi friends

When i upload a photo via this function

Code: Select all

 
    //////////////////////////////////////////////////////////////////////////////////
    // Name :           uploadFile 
    // Type :           code
    // info :           string uploadFile(string $fileFieldName,string $directory)
    // Description : 
    //                  Gets the file name then uploads the file into the spesified
    //                  Directory
    //          parsiTech web Development Department
    //////////////////////////////////////////////////////////////////////////////////
    
    function uploadFile($fileFieldName,$directory)
    {
            $photoName = $_FILES[$fileFieldName]['name'];
            $photoName = str_replace(' ','_',$photoName);
            move_uploaded_file($_FILES[$fileFieldName]['tmp_name'],$directory.$photoName);
            return $photoName;
    }   // uploadFile
 
it works properly and the file uploads no error occured but the files and the images i upload via this function be came unread able and only php can delete or modify them i even can not copy the to another directory
Pease help me what should i do

Re: image upload problem

Posted: Mon May 19, 2008 4:43 am
by VladSun
File/directory permissions issue.
hannnndy wrote:be came unread able and only php can delete or modify them i even can not copy the to another directory
You mean that you can't edit/delete/view'em by using FTP?

Re: image upload problem

Posted: Mon May 19, 2008 4:48 am
by hannnndy
hi dude

no no i meant that
1.php has successfuly uploaaded that file
2.the image is being shown successfuly in the pages
3.when i try to delete the uploaded files on my pc using win/linux it s imposible
4.i should only delete the files using the php
5.i want to delete my files or move them when ever i want :!:

thanks for attention :wink: