HTTP Error 500.50 after upload a file in laravel on IIS

2

I make a file upload in php/laravel. The files go into public/uploads directory.

But, if I access the file on the url testlocal/site/public/uploads/files.pdf, I receive this error:

HTTP-Error 500.50 - URL Rewrite Module Error.

But, if I copy this file from normal windows explorer, to the public/uploads directory, it works :|

My webconfig

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
      <rewrite>
          <rules>
              <rule name="Imported Rule 1" stopProcessing="true">
                  <match url="^" ignoreCase="false" />
                  <conditions logicalGrouping="MatchAll">
                      <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                      <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                  </conditions>
                  <action type="Rewrite" url="index.php" />
              </rule>
          </rules>
      </rewrite>
  </system.webServer>

And my file upload

if (Input::hasFile('file')) {

    $file = Input::file("file");
    $size = $file->getSize();

    $originalName = $file->getClientOriginalName();
    $fileName = time() . "-" . str_random(5);
    $extension = $file->getClientOriginalExtension();

    if($file->move(__DIR__ . '/../../../public/uploads/', $fileName . "." . $extension)) {
      $upload = new Upload();
      // ...
      $upload->save();

      $answer = array( 'answer' => 'File transfer completed' );
      $json = json_encode( $answer );

      echo $json;
    }

Error Code: 0x80070005

// Edit: Ok, if i give them file everyone access, it works...but how can i make this automatic?

php
laravel
iis
upload
asked on Stack Overflow Apr 20, 2015 by nutzt • edited Jan 9, 2017 by Tiffany

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0