Whenever I upload csv files, after the file uploaded it changed to .txt
the path I echo "$path";
showing the file format saved is .txt not .csv.
Is there anyway to store the file with actual .csv or I just made mistake somewhere?
here's my form
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Upload file</title>
</head>
<body>
<form class="" action="" enctype="multipart/form-data" method="post">
<input type="file" name="csv" value="">
<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
<br>
<button type="submit" name="button">upload file</button>
</form>
</body>
</html>
and here's the controller
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\URL;
use Storage;
class store extends Controller {
function index(request $request){
$path=$request->file('csv')->store('csv');
echo "$path";
}
}
?>
result of uploaded csv
csv/VKgVPMvwcQKqpqHAXZ1s6o1IyIbz5BkgQqjxotPc.txt
Thank you.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2uUxgPy
via IFTTT
Aucun commentaire:
Enregistrer un commentaire