Error: Uploading data to spreadsheet with special characters

I have created script to upload image data and info, i am getting error in upload info without special characters.
Special characters such as: Vietnamese, accented characters (Â, ô, ơ, á, ã, ả…)

function doPost(e) {
var data = Utilities.base64Decode(e.parameters.FILE);
var blob = Utilities.newBlob(data, e.parameters.MIMETYPE, e.parameters.NAMA_FILE);
var fileID = DriveApp.getFolderById(e.parameters.FOLDER_ID).createFile(blob).getId();
var name = e.parameters.NAMA_FILE[0];
var namet = e.parameters.namet[0];
var imageID = “https://drive.google.com/uc?id=”+fileID;
var ss = SpreadsheetApp.openByUrl(‘testcam1 - Google Sheets’);
var sh = ss.getSheets()[0];
sh.appendRow([name,namet,imageID]);
if (fileID){
return ContentService.createTextOutput(“Image uploaded successfully”);
}else{
return ContentService.createTextOutput(“Data Failed to Save!”);
}
}

I think the problem: “e.parameters” in the script.
I tried using functions like: " var namet = JSON.parse(e.postData.contents);" but Script was error.
I’m new to this so I don’t know much, hope someone can help.


Have you used this block for the text box??

2 Likes

I’m using this block:

After adding this blocks too you didn’t get such entry in gsheet?? Surprise…

Script code implies that, that box is meant for file name… So it is not working… let we wait for anyother to give suggestions

thank you, i succeeded. I relied on the pages you sent me to create this script.

1 Like

I consulted the pages about: “how to send data and images to the spreadsheet” and created this Script, it works the way I want.
thank you so much!

1 Like

Can you share the link, if you don’t mind??? In future it will be helpful to someone

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.