image upload problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
hannnndy
Forum Contributor
Posts: 131
Joined: Sat Jan 12, 2008 2:09 am
Location: Iran>Tehran
Contact:

image upload problem

Post 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
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: image upload problem

Post 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?
There are 10 types of people in this world, those who understand binary and those who don't
User avatar
hannnndy
Forum Contributor
Posts: 131
Joined: Sat Jan 12, 2008 2:09 am
Location: Iran>Tehran
Contact:

Re: image upload problem

Post 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:
Post Reply