19
Views
4
Comments
Save an uploaded image to a file
Question
I want to use a third party server to create Latex images (png) on the fly, but I want that those images will afterwards be saved on a folder on my server for later use.

As an example, a command I use to the server is:
<img src="https://latex.codecogs.com/png.latex?\small&amp;space;\fn_jvn&amp;space; A = \frac{a^{2}\sqrt{3}}{4}">
The image is properly created and shown to the user, but I cannot figure out how to save it in my server.
Can somone help me how to save this image localy?

2012-03-02 13-17-21
Paulo Ramos
Staff
Hi,
Try using the HttpBinaryGet action from RichMail (part of system components) to retrieve the image (as Binary Data). You can then save it to the filesystem or DB.
2013-08-15 16-58-37
Antonio Xeira
It worked like a charm, thanks.


Capture.PNG
2011-06-15 10-50-19
Miguel Ventura
Staff
António,

I'm glad you reached a solution for your problem, but if your ultimate goal is to display LaTeX formulas in web pages, you may consider using MathJax for that purpose as it doesn't imply converting everything to images.

Cheers,
Miguel
2013-08-15 16-58-37
Antonio Xeira
I understand, but my goal is to remove load from the server.
In a page I can have 20-30 latex generated images.
If I store the images the loading time will be quicker, and the load (of generating those images in real time on the server) will be null.
My ideia is to check first if the image is already there, if not, I generate the image and store it automaticaly for next time.
Comments?
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.