Форуми / Cotonti / Extensions / Add a page and then crop image

Macik
#39922 13.09.2014 17:26

As I see, there are 3 way to solve a problem^

  1. Use raw «base64 PNG» image data — for that use common input field type `text`. Than decode it on serverside and save as normal PNG file.
  2. Made JS code for follows: convert `PNG data:image` → canvas → common `img` tag with desired format (PNG/JPG/GIF) → «data:image with certain format». Save it to server as noted in p.1
  3. [not sure for that] Get binary data from base64 and try to send it via AJAX emulating common POST form file uploading (`multipart/form-data`)

Note: you can not use code to attach any data via input type `file` directly.

https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F