spatie / mailcoach-support

Questions and support for Mailcoach
https://mailcoach.app
31 stars 2 forks source link

Uploading image in unlayer does not work #158

Closed rnleal closed 4 years ago

rnleal commented 4 years ago

When uploading image using unlayer, the progress spinner is stuck to 50%. Screen Shot 2020-04-19 at 1 41 36 PM

Although, the ajax upload is successful.

freekmurze commented 4 years ago

Do you get any error in the application log? Is the endpoint where you are uploading to giving a response?

What is the maximum post size and upload size you have set in your php.ini?

rnleal commented 4 years ago

Do you get any error in the application log? Is the endpoint where you are uploading to giving a response?

What is the maximum post size and upload size you have set in your php.ini?

There is no error on the application log. The file was uploaded upon checking on the directory. Both post size and upload size are 100M

betaselect commented 4 years ago

I have the same issue as rnleal. The AJAX uploader works until 50% complete and then just freezes. No further errors in the application log or in the Debugbar. Relevant information: I use digital ocean spaces as S3 like storage, Laravel 7.6.2, Mailcoach 2.7.1

Edit: Did some further investigation: the files does get uploaded to server. I can see it in the database under media and mailcoach_uploads . And it's uploading the file to my local storage public folder. Where it creates a new folder for each upload? (E.g. a folder with the name: 1, containing the upload and a conversion folder?)

riasvdv commented 4 years ago

Can you check in your browser console or network tab what the response returns?

It should contain a json response with only a "url" key like this:

image

If you have this response, can you check if the url is accessible?

freekmurze commented 4 years ago

@InWave could you let us know what the response from that endpoint is? ⏫

rnleal commented 4 years ago

The response is a url and the file has been uploaded, but just like @InWave's issue, on the frontend, it stuck on 50%.

I also want to add that this only happens on the package version, it is working perfectly fine on the App version.

riasvdv commented 4 years ago

Is the URL accessible? If you copy paste it in your browser?

betaselect commented 4 years ago

Sorry missed the response, @riasvdv @freekmurze.

This is the response:

image

And indeed the URL is not accessible from the browser. Although this is not unexpected behavior all my files uploads in the rest of the application are done to Spaces from DigitalOcean.

riasvdv commented 4 years ago

Unlayer needs to be able to access the image to finish uploading and displaying it, make sure you're uploading to a publicly accessible bucket.

riasvdv commented 4 years ago

It could also be possible you still have to run php artisan storage:link in your Laravel install so the public disk is accessible https://laravel.com/docs/master/filesystem#the-public-disk