jogesh_pi's avatar

Validate if the file uploaded successfully

Is there a way to check if the file validated successfully from the Storage facades. Storage::putFile('uploads', $request->file('file')) This is what we have but sometimes the image uploads not working for some reason. I just like to know if there is a way to check like isValid() or something else?

Thanks

0 likes
3 replies
jogesh_pi's avatar

@Nakov Thank you for the response. The validation i just added but still curious if there is a way to know for the successful file upload?

Sinnbeck's avatar

@jogesh_pi that is what validation is for. The moving of the file to the correct directory is not the upload. The upload happens before validation, and validation ensures that the file was uploaded correctly

So follow the advice by @nakov and you should be able to catch any issues

Please or to participate in this conversation.