Mercurial Hosting > freedit
diff src/lib/Shared.luan @ 34:c8d47981c74f
upload using ajax
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 02 Aug 2022 20:46:02 -0600 |
parents | 4fdc4ec0050b |
children | 0c1b820fff34 |
line wrap: on
line diff
--- a/src/lib/Shared.luan Mon Aug 01 22:50:16 2022 -0600 +++ b/src/lib/Shared.luan Tue Aug 02 20:46:02 2022 -0600 @@ -96,20 +96,4 @@ end end -function Shared.get_url_from_file(file) - local url = "https://upload.uploadcare.com/base/" - local options = { - method = "POST" - enctype = "multipart/form-data" - parameters = { - UPLOADCARE_PUB_KEY = "fe3d30f3088a50941d45" - file = file - } - } - local response = uri(url,options).read_text() - response = json_parse(response) - local code = response.file or error() - return "https://ucarecdn.com/"..code.."/"..file.filename -end - return Shared