How to save images on own server


#1

There isn’t nothing complicated, change confs.options.urlToUploadImage from app.js ( line 73 ) to your own path, and try to upload an image!

Your path must receive a POST request with new FormData() which will have upload parameter. In this upload parameter will be your image for uploading, make all changes in you server and return a JSON format like
{ status_code: 200, data: { img_url: 'full path of your image', thumb_url: 'thumb path for your image' } } in case of success or {status_code: 'whatever ;)', status_txt: 'Uploading problem here!'} in case of some error.


Image upload is not working
#2

I changed the url to go in my file, but in function it falls into the error condition, I do not know how to fix


#3

Please leave a screenshot of your error here!
And what are your programming skills?


#4

So, just appears ‘undefined’, I work with javascript, php …


#5

Please leave a screenshot of your console with error and your changed code!


#6


#7

Here are the impressions of my code, where I try to upload an image to my server.


#8

It seems you didn’t do correctly your code on your server side!

Give me your response from Console->Network


#9


#10

There’s nothing with ‘arquivo’, try to replace $_FILES['arquivo'] to $_FILES['upload']


#11

I made the change, but now it takes a while to load and in the end it gives undefined.


#12

Follow the code with your change


#13

I was able to write to my server, but I was not able to return “data.img_url” as requested in the app.js file


#14

So did you solve your issue?


#15

In parts, the image saves on my server, but does not show in the plugin, I do not know how to return to the plugin understand “data.img_url”