Reputation: 334
I want to upload an image that has been edited in the Adobe Creative SDK Image Editor to my own server.
The Image Editor returns me a temporary URL for the edited image. How do I upload that edited image to my server?
Upvotes: 0
Views: 228
Reputation: 1481
The Creative SDK Image Editor does not save to Creative Cloud by default.
There are Creative Cloud APIs for iOS, Android, and Web, but you would have to actually use those APIs in your code before any saving to Creative Cloud takes place.
onSave
propertyAs you note, the Creative SDK Image Editor for Web returns a temporary URL in the Aviary.Feather()
configuration object's onSave
property:
// Example Image Editor configuration
var csdkImageEditor = new Aviary.Feather({
apiKey: '<YOUR_KEY_HERE>',
onSave: function(imageID, newURL) {
// Things to do when the image is saved
currentImage.src = newURL;
csdkImageEditor.close();
console.log(newURL);
},
onError: function(errorObj) {
// Things to do when there is an error saving
console.log(errorObj.code);
console.log(errorObj.message);
console.log(errorObj.args);
}
});
You can do anything you like in the onSave
function, including posting to your own server. Just send the temporary newURL
to your server and have the server save the image to the appropriate place.
How you go about posting from the client and saving on the server will depend on your stack.
It would be a good idea to search around Stackoverflow for questions related to "saving an image from a URL to a server", based on the stack that you are using. As just one example, here is an answer related to server-side saving with PHP.
(You may also benefit from having a look at my answer to a related question on saving the edited image.)
Upvotes: 1