I've been using this to upload images to google drive for over a year with no problems. But starting in February none of the jpeg uploaded images can be viewed by any browser. I suspect that something changed at google and I need to update the code. I've searched, but I found nothing about and changes.
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<script>
function updateUrl(imageUrl) {
var div = document.getElementById('output');
div.innerHTML = imageUrl;
}
</script>
<form>
<label>INCLUIR IMAGEM</label><input type="file" accept="image/*" capture="camera"
name="imageFile"/>
<!-- <input type="file" name="imageFile">-->
<input type="button" value="Upload File"
onclick="google.script.run.withSuccessHandler(updateUrl).upload(this.parentNode)">
</form><br/><br/>
<div id="output"></div>
</body>
</html>
code.GS
function upload(e) {
// Folder ID of destination folder
var destination_id = '1qghuk1-kShwsdfsdf8Ndfsdfsddffs';
var contentType = 'image/jpeg';
var imageUrl = e.imageFile;
var destination = DriveApp.getFolderById(destination_id);
var file = destination.createFile(imageUrl);
var imageUrl = Drive.Files.get(file.getId()).webContentLink;
// Logger.log(imageUrl)
var reformatUrl = imageUrl.replace("?", "?export=view&").replace("&export=download", "")
//Logger.log(reformatUrl);
return reformatUrl;
}