Welcome Guest, Not a member yet? Register   Sign In
Could not move file to
#1

(This post was last modified: 02-11-2020, 09:43 AM by JerryCode.)

PHP Code:
public function index(){
    
$file= new \CodeIgniter\Files\File('https://www.***.com/***.jpg');
    
$type $file->getExtension();
    
//success:jpg
    
$newName $file->getRandomName();
    
$file->move(WRITEPATH.'uploads',$newName);
    
//error:
    //CodeIgniter\Files\Exceptions\FileException
    //Could not move file ***.jpg to D:\\WWW\ci\writable\uploads/ ()




error:
CodeIgniter\Files\Exceptions\FileException
Could not move file ***.jpg to D:\\WWW\ci\writable\uploads/ ()
Reply
#2

(This post was last modified: 02-11-2020, 11:19 AM by dave friend.)

Does the destination exist?
Do the permissions of the destination allow for file write operations?
Reply
#3

(02-11-2020, 11:19 AM)dave friend Wrote: Does the destination exist?
Do the permissions of the destination allow for file write operations?

Yes,Is locally developed
Reply
#4

Hello JerryCode !

Using localhost doesn't mean you have the correct permissions to write in the folders. You should verify ;-)

And you could also try to create a random file to see if you there is no permissions issues with CI: https://www.php.net/manual/fr/function.f...ntents.php
Reply




Theme © iAndrew 2016 - Forum software by © MyBB