cannot upload a zip file
Hello, I'm testing to upload a zip file with this code and I believe is applicable with any file types.
public function store(Request $request)
{
$file = $request->file('filename');
$filename = $file->getClientOriginalName();
$file->move(public_path(), $filename);
return redirect()->back();
}
It would just keep loading and no errors are showing in my network tab.
And maybe try restating the php service on your computer if it hangs :)
@Sinnbeck
<form autocomplete="off" method="POST" action="{{ route("data.store") }}" enctype="multipart/form-data">
@csrf
<div class="form-group">
<input type="file" name="filename">
</div>
<div class="form-group">
<button class="btn btn-success" type="submit">
Save
</button>
</div>
</form>
@Bossino does it ever stop loading so you can use the rest of the app and try again?
Do you perhaps have xdebug running?
@Sinnbeck I don't have xdebug running. It doesn't stop loading. I just checked in my network tab but no errors showing.
@Bossino think php is stuck. Try restarting the process or your computer
Be aware that your code let's anyone "hack" your website in minutes
@Sinnbeck just my practice code before applying it in my final project and is only running in my local
Please or to participate in this conversation.