lakesare / memcode

Spaced-repetition: with real formatting.
http://memcode.com
MIT License
339 stars 73 forks source link

Import option with Image upload #192

Open jorgelamb opened 1 year ago

jorgelamb commented 1 year ago

Hi,

We would like to import many flashcards to one Course. We haven't found a way to upload images to the flashcards when importing them with the .xls file.

It would be great to support something like [image]https://www.example.com/myImage.jpg[/image] so that it gets uploaded and can be used.

We have tried using HTML to show the image but the image is not loaded in memcode because of the headers sent in the request.

Thanks!

lakesare commented 1 year ago

Hi! Hm weird, did <img src="https://www.example.com/myImage.jpg"/> not work? Is that the image url you tried?

jorgelamb commented 1 year ago

Hi,

Here's an image I tested: https://fundacioncnse-dilse.org/bddilse/images/stories/test.png

When you load it directly on the browser y works ok, but when you load it from inside memcode the server rejects the request, as it doesn't come from their site.

I can try to provide a sample imported test in a course next week.

Note: If after loading the image from the browser it keeps working even in memcode, it should be easy to find other images on that site to test it.

Cheers

jorgelamb commented 1 year ago

Hi,

Here's a Course with that same image imported: https://www.memcode.com/courses/9827

The image fails to load, even before returning an HTTP error code, the connection is closed by the server.

image

Using the developer tools > Copy as cURL and running it from a terminal, that exact command fails, but removing the "referer" header (value https://www.memcode.com/) the request does work. I think this is something from the server preventing this type of usage.

Cheers, Jorge