3

I am working with Laravel 5 and I am trying to use FineUploder. Here is what I used

PHP-Traditional

First I was having VerifyCsrfToken error and as a temporary commented out

\App\Http\Middleware\VerifyCsrfToken::class,

From

App/Http/Kernel.php

CsrfToken error gone!

Now I am having "Uploads directory isn't writable" error.

My Route

Route::resource('endpoint','FineUploaderController');

My FineUploaderController

public function store(Request $request)
{
     // dd('store');
     return view('fineupload.endpoint');
}

My upload Folder inside public folder

/uploads/receiptuploads

And endpoint.php

if ($method == "POST") {
header("Content-Type: text/plain");

// Assumes you have a chunking.success.endpoint set to point here with a query parameter of "done".
// For example: /myserver/handlers/endpoint.php?done
if (isset($_GET["done"])) {
    $result = $uploader->combineChunks("/uploads/receiptuploads");
}
// Handles upload requests
else {
    // Call handleUpload() with the name of the folder, relative to PHP's getcwd()
    $result = $uploader->handleUpload("/uploads/receiptuploads");

    // To return a name used for uploaded file you can use the following line.
    $result["uploadName"] = $uploader->getUploadName();
}

echo json_encode($result);
}
// for delete file requests
else if ($method == "DELETE") {
    $result = $uploader->handleDelete("/uploads/receiptuploads");
    echo json_encode($result);
}
else {
    header("HTTP/1.0 405 Method Not Allowed");
}

?>
Cœur
  • 37,241
  • 25
  • 195
  • 267
ErcanE
  • 1,571
  • 3
  • 19
  • 28

1 Answers1

0

Simple solution: you will need to make the "/uploads" directory writeable for whatever user is running the PHP server. If you have attempted to do this and are stuck with the same result, you have most definitely either assigned the wrong permissions, or are targeting the wrong directory.

Note that you will need to do the same for whichever directory is configured to temporary store file chunks.

Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82
  • 2
    Thanks for your reply. How can I confirm that I am targeting right directory? is there any way to find out path? – ErcanE Aug 26 '15 at 14:51