Well, I set the S3_BUCKET_PREFIX environemnt variable to parse_testing/
since this is the main folder of the bucket I’m trying to save my files. After that I tried a lot of different ways to add a new folder path to save specific files, succeeding with none. In this project I show what I’ve tried and why does not work. Most relevant tries were:
- Setting the file name with path of its specific folder:
const filetext = await readFile()
const parseFile = new Parse.File('/audios/new_audio.mp3', {base64: filetext})
return parseFile.save({useMasterKey: true})
has no effect whatsoever, it just saves the file in the folder of the bucket prefix.
- This is the interesting try, when setting the absolute path within the bucket prefix folder, I receive an error from parse with an HTML message:
const filetext = await readFile()
const parseFile = new Parse.File('audios/new_audio.mp3', {base64: filetext})
return parseFile.save({useMasterKey: true})
and I receive the following error:
{
"code": 107,
"error": "Received an error with invalid JSON from Parse:
<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta
charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n
<pre>Cannot POST /parse/files/audios/new_audio.mp3
</pre>\n</body>\n</html>\n"
}
So my questions are:
Is this a limitation from ParseFile ? Since when I put the path it ‘ignores’ it.
Why does this error occur ?
Should I create an issue to trying fixing this problem an be able to set paths when saving files ?
PS: Setting the whole path for saving specific files in S3_BUCKET_PREFIX works but it’s not the ideal solution, since I don’t want all my files to be saved there. For instance, setting parse_testing/audios/
as bucket prefix would work but would cause all my files to be saved there.