My problem is this!
Is there a solution or only when we have the Wix Media Platform will we be able to do something?
Congratulations to the whole Wix family, I have all my respect and I learn a lot from you.
#AmazonS3
#Amazon
#file
#upload
#upload_button
Firstly, great way to show the problem…
Secondly, we are all still learning ourselves too!
As for the upload button and it passing an empty object.
You are probably already aware of this, however you do know that when you use the upload button that there are two parts to that process?
https://www.wix.com/corvid/reference/$w.UploadButton.html
UploadButton
An upload button enables users to upload files to your site.
Typical File Upload Scenario
In a typical scenario, the page from which files are uploaded contains an upload button and another element, such as a regular button. The user chooses which file to upload by clicking the upload button and selecting the file in a native file chooser dialog. At that point the file is stored in the upload button’s value property as a File object. Then the user triggers an event, such as a button click, on the other element. That element’s event handler calls the startUpload() function to perform the actual upload. The upload either succeeds and gives you an UploadedFile object, or fails and gives you an UploadError object.
Examples
Typical file upload scenario
$w('#myButton').onClick( () => {
if ($w("#myUploadButton").value.length > 0) { // user chose a file
console.log("Uploading " + $w("#myUploadButton").value[0].name);
$w("#myUploadButton").startUpload()
.then( (uploadedFile) => {
console.log("Upload successful. File is available here:");
console.log(uploadedFile.url);
} )
.catch( (uploadError) => {
console.log("File upload error: " + uploadError.errorCode);
console.log(uploadError.errorDescription);
} );
}
else { // user clicked button but didn't chose a file
console.log("Please choose a file to upload.")
}
} );
So what you actually get back in return is an object which only contains the url of the uploaded file.
https://www.wix.com/corvid/reference/$w.UploadButton.html#UploadedFile
UploadedFile
The object returned by the startUpload() function’s Promise that contains the URL of the successfully uploaded file.
Examples
Get uploaded file information
$w("#myUploadButton").startUpload()
.then( (uploadedFile) => {
let url = uploadedFile.url; // "wix:image://v1/68d3a9_1de7529c444b4c9eb38401f8efe0cad2.jpg/flowers.jpg#originWidth=1970&originHeight=1120"
} )
.catch( (uploadError) => {
let errCode = uploadError.errorCode; // 7751
let errDesc = uploadError.errorDescription; // "Error description"
} );
You read more about saving the actual file without code here.
https://support.wix.com/en/article/working-with-the-connect-upload-button-panel
Or with code in this tutorial here.
https://support.wix.com/en/article/wix-code-using-the-upload-button-with-code
Plus, apologies if you already know all of this and it does not help you in the slightest.
If you would like to have an advanced cloud file server integrated with Corvid. Please help me by voting for this resource through this link:
https://www.wix.com/corvid/requested-feature/wix-media-platform-with-corvid?page=5
It is a project developed by Wix called: Wix Media Platform
Make feature requests on t he Wishlist Page , the official platform for requesting new features. You can vote, comment, and track the status of the requested features.