Quand je télécharge une image je ne peux pas la lire sur certains téléphones (When I download an image I can't read it on certain phones)

par contre je ne vois pas ce que vous voulez dire alors par "ou simplement y définir l'ID du fichier, puis gérer cela pour créer l'URL complète et afficher l'image dans l'application" ?
avez vous un exemple ?

as above:

image

alors je n'ai pas compris, car je croyais que c'était ce que je faisais. Je ne comprends pas ou je dois mettre cette URL ?

ceci est l'URL de google drive :
https://drive.google.com/drive/folders/1u-C2WP_O1asjVhzzKpEdabKixlFDiWxK?usp=drive_link

est ce qu'il faut que je modifie dans google drive cette URL comme ceci :
https://drive.google.com/uc?export=download&id=<fileID

pourquoi personne veut me dire comment modifier et placer l'adresse URL ??????

If you click with right button on you image (google drive) you will see a "Share" option and then a "Copy link". If you click on "Copy link" and paste it in, a notepad you will see this:

htt ps://drive.google.com/file/d/1N3q-xgidrh3GyOeZ2Ij9w4DZlOEuXnJg/view?usp=drive_link

htt ps://drive.google.com/file/d/1eDXQItd5yVfqLbW8ZZsh1CwU0dYqDciK/view?usp=drive_link

those parts in bold are the ID of your google drive photos.

You can store those IDs in your google sheets and, when you want to see them, get that ID from googleSheet and make the URL https://drive.google.com/uc?export=download&id=<your_recovered_id_from_googleSheet>.

1 Like

And I don't usually waste time on this...but this time I have to answer you:

Since I have been registered in this community I think you are one of the users who has received the most help from other users...I know that even personal help...so a little patience and gratitude, please.

1 Like

Je suis désolé si vous l'avez mal pris mais ce n'était pas mon intention , c'est juste que je ne savais pas si ma question était claire car je l'ai pausé plusieurs fois et que l'on ne me répondait pas clairement . Sur le fait que je demande beaucoup d'aide, c'est parce que je suis une débutante qui essaye d'apprendre , mais ce n'est pas évident quand on a personne de vive voix pour expliquer. Je comprends mieux avec des exemples concrets.
Et merci pour votre réponse.

D'accord pour le chemin de ID, si je stocke l' identifiant de l'image dans la feuille google j'aurais toujours la même image ?
mon souhait et de changer d'image de temps en temps en téléchargement à partir de l'application.
Et pour créer l'URL j'ai fais comme ça : https://drive.google.com/uc?export=download&id= 1N3q-xgidrh3GyOeZ2Ij9w4DZlOEuXnJg (c'est l'identifiant de l'image), mais ou dois-je placer l'URL ? comment l'obtenir à partir de googlesheet ?

https://drive.google.com/uc?export=download&id=

This partial url does not change. You simply add the file ID to the end.

The script I provided gets and returns to the app the file ID when the image is uploaded to Google drive

With the partial url and the file ID you can display the image.

How many times do we have to tell you this ?

oui ça j'ai compris, j'ai ajouté l'ID .

ok, ça c'est bon.

ok aussi.

Mais cette URL partielle je la place dans le script ?

For the very last time

With the partial url and the file ID you can display the image in the app, you can use an image component.

You do not need to put it in your google apps script, there is no place for it, either in the part of the script that uploads the image file to google drive, nor in the part of the script that sets the data to your spreadsheet.

If you want, you can combine the partial url and the file Id, and post this to your google spreadsheet, instead of just the file Id, then you do not have to combine the two in the app to display the image.

ok , là je comprends.

donc maintenant si je comprends bien, il faut modifier directement l' URL de mon image depuis le google drive pour créer cette URL partielle avec l'ID ?

je ne peux pas modifier l'URL , c'est bizarre ?

???
the url has 2 parts, a constant part and the id
usually you store only the id in the Google Spreadsheet
and if you need the url of one of the images, then you just join the constant part, which is

and the id of a specific image

Taifun

oui je l'ai compris qu'il faut associer l'URL à l'identifiant de l'image.
Je n'arrive pas à vous expliquer ce que je cherche à savoir : J'aimerais connaitre le cheminement complet qui permet d'obtenir (ou créer) cette URL partielle pour que je puisse rejoindre l'identifiant de l'image et ensuite je pourrais revoir les blocs .

Sorry, I do not understand your question...
Probably you are confused? Actually it is very simple to join a fix part and an id to get the complete url... I realty do not know, what exactly is so complicated about it...

Taifun

ok je vais faire autrement , je vais vous expliquer ce que j'ai déjà fais et compris :

1 - j'ai créér un dossier "image appinventor" dans mon google drive.

2 - j'ai le script avec l'id de google drive :
function doPost(e) {
var data = Utilities.base64Decode(e.parameters.data);
var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);
var fileID = DriveApp.getFolderById('1u-C2WP_O1asjVhzzKpEdabKixlFDiWxK').createFile(blob).getId();
return ContentService.createTextOutput(fileID);

3 - je télécharge des images qui se trouvent dans la galerie de mon téléphone et qui se placent dans le dossier "image appinventor" de mon drive.

4 - je copie " https://drive.google.com/uc?export=download&id=" dans mon bloc note.

5 - je récupère l'ID de l'image qui est par exemple 1eDXQItd5yVfqLbW8ZZsh1CwU0dYqDciK

6 - je colle l'ID de l'image dans mon bloc note à URL comme ça :
Capture3

et c'est là que je ne sais pas comment faire avec l'URL , que dois je faire ensuite ?
pour le moment elle est dans mon bloc note.

My understanding up to now was, your app is about sharing some information and corresponding images among several users... to store the information a Google Spreadsheet is used and the inages are stored in Google Drive...is this correct?
All users should be able to add information and images? And all users should be able to see the information and corresponding images?
Can you confirm? Or is it different?

Taifun

oui

oui , obligé car sinon les autres utilisateurs n'ont pas l'image.

oui exactement, tous les utilisateurs du même compte.

Capture4

j'ai testé ça aussi (je l'ai copié /collé dans la feuille de calcul), je reçois l'image dans mon application , et les utilisateurs l'on aussi.
Mais si je télécharge une nouvelle image depuis l'application je n'ai plus l'adresse URL (https://drive.google.com/uc?export=download&id=) dans la feuille de calcul ?

When you upload a new image to drive, you have to get its ID and store it in googleSheet.

when you want to see that image in any device, then you have to use the URL "https://drive.google.com/uc?export=download&id=" plus the ID stored in googleSheet (so, you need to read from googleSheet that ID).

Or you can directly store in googleSheet "https://drive.google.com/uc?export=download&id=" plus the ID. And when you want to see the image, recover from googleShet the URL.

Anyway, It seems you are storing not the image ID (for example 1eDXQItd5yVfqLbW8ZZsh1CwU0dYqDciK), but the folder ID 1u-C2WP_O1asjVhzzKpEdabKixlFDiWxK.

The image ID is what the script returns

oui j'ai ID du dossier .
Donc je dois mettre l'URL dans le bloc du bouton pour pouvoir la stocker dans googlesheet ?