How can I upload / download image from my google drive using matlab?

조회 수: 16 (최근 30일)
ghassan78
ghassan78 2018년 12월 25일
답변: Richard Zapor 2023년 6월 17일
How can i upload / download image from my google drive?
  댓글 수: 3
ghassan78
ghassan78 2018년 12월 25일
편집: madhan ravi 2018년 12월 25일
Thank you so much (Walter Roberson) for your answer.
I succeed to download the image from google cloud by the code:
img = imread('https://drive.google.com/uc?id=0B6Z9gtnwRLLTMDVTRWptemVwemM', 'jpg');
imshow(img);
imwrite(img,'img.jpg','jpg');
But I couldnot to store(upload) the image on google cloud, please help.
Walter Roberson
Walter Roberson 2018년 12월 26일
In the Answer I mention , I linked to a discussion from Cris on how to store files on Google Drive .

댓글을 달려면 로그인하십시오.

채택된 답변

Cris LaPierre
Cris LaPierre 2018년 12월 26일
편집: Cris LaPierre 2019년 1월 12일
Since Walter has pointed you to a question I asked a couple times now, I'll chime in that I abandoned my attempts to do this in Google Drive.
A question for you - does it have to be google drive? If not, I'd suggest trying to do this in Dropbox first. It works, and you can be up and running with minimal effort on your part. There are programs available on the file exchange for both uploading and downloading files from Dropbox.
I have gotten that to work.

추가 답변 (1개)

Richard Zapor
Richard Zapor 2023년 6월 17일
Two changes are required to download from a google drive.
1) Set the privilege to Anyone with the link for the file using the triple dots
2) Given a filename of below format: tweak- file/d to uc?export=download&id= while removing /view?usp=sharing
if resourcekey=RESOURCE_KEY exists then also include at the end per Overleaf
Works for urlwrite and imread
urlwrite('https://drive.google.com/uc?export=download&id=1v3GsGgP3p905wzdvUqypL_-djYmxiyzK','2.png');
img=imread('https://drive.google.com/uc?export=download&id=1v3GsGgP3p905wzdvUqypL_-djYmxiyzK','png')
img2=imread('https://drive.google.com/uc?export=download&id=1v3GsGgP3p905wzdvUqypL_-djYmxiyzK');
solution credit to https://www.overleaf.com/learn/how-to/How_can_I_upload_files_from_Google_Drive%3F

카테고리

Help CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by