lundi 19 février 2018

fopen(): Filename cannot be empty - Laravel 5 IIS 7

im facing this problem all day long, i already saw this question(Laravel 5.4 fopen(): Filename cannot be empty) and nothing...

I already edit permission on my C:\Windows\Temp full control to my IISR_IUSERS i'm using NTS PHP version on my IIS 7 on windows server 2008 R2.

on my Laravel code i'm doing this:

$input['picture_url'] = $request->file($fileInForm)->store('uploads');

on my development enviroment it's a Macosx And i was doing this to save the imagem to my uploads folder that i configure like this:

    /*My code to upload imagem on MACOSX dev enviroment*/

    $input = array();

    $fileInForm = 'picture_url';

    if ($request->hasFile($fileInForm)) {
    $file = $request->file($fileInForm);
    if ($file->isValid()) 
    {
        var_dump($request->file('default_picture_url')->path());
        die();

        // Filename is hashed filename + part of timestamp
        $hashedName = hash_file('md5', $file->pathName());
        //$timestamp = (microtime() * 1000000);

        $newFilename = $hashedName . '.' . $file->getClientOriginalExtension();

       Storage::disk('uploads')->put($newFilename, file_get_contents($file));

       $input['default_picture_url'] = '/uploads/'.$newFilename;
    }
    }

/*My filesystems.php*/
'uploads' => [
            'driver' => 'local',
            'root' => public_path().'/uploads' 
        ],

and i already modified php.ini 'upload_tmp_dir' to 'C:\Windows\Temp' or 'C:/Windows/Temp'

can anyone help me with this please!



via Chebli Mohamed

1 commentaire:

  1. Hi, I came across same issue and able to resolve it by creating new folder iis_temp in c directory and change path in php.ini => upload_tmp_dir = "C:\iis_temp"

    and finally adding full permissions to 3 users
    current user currently logged in
    additionally : IUSR , IIS_IUSRS

    RépondreSupprimer