I am working with Laravel 5 and I am trying to use FineUploder. Here is what I used
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");
}
?>
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1NBlKwm
via IFTTT
Aucun commentaire:
Enregistrer un commentaire