I was wondering if I could open a pdf from my google drive to a certain page on a browser tab using Pydrive. I saw threads where uploading and downloading files was possible so I assumed that simply opening files would be possible.
You can use PyDrive library to upload or download any docs from google drive. I recommend you to go through the link below and see how it goes.
https://pythonhosted.org/PyDrive/
Related
I am trying to download a document without saving to memory and then upload to s3. my issue is that the document i want to download doesn't have its own url when you click on it, in the webpage. it comes up as a pop-up and wants you to actually click download.
can i click download and upload it directly to s3 without downloading to another local folder?
i attempted to use request code but need a url to do this
I have tried several ways ,but not able to resolve the problem .can we customize browsing functionality in colab?
I am using uploaded = files.upload() for browse button functionality in colab, but I want whenever user click browse direct dialogue box for given path should open rather than choose files option.
The situation that you discuss is possible if you build your own customized application. But google collab is a proprietary application of google and it has a certain set of operations to do tasks smoothly. Apart from that as you say
"user click browse direct dialogue box for given path should open rather than choose files option"
how it is possible that google colab now what you want to upload. That's why google colab gives you the facility to upload the file as per your requirement. It makes the application more robust and easy to use.
As per Google colab documentation, it is not possible.
I have a json file with over 16k urls of images, which I parse using a python script and use urllib.request.urlretrieve in it to retrieve images. I uploaded the json file to google drive and run the python script in google Colab.
Though the files were downloaded (I checked this using a print line in the try block of urlretrieve) and it took substantial time to download them, I am unable to see where it has stored these files. When I had run the same script on my local machine, it stored the files in the current folder.
As an answer to this question suggests, the files may be downloaded to some temporary location, say, on some cloud. Is there a way to dump these temporary files to google drive?
(*Note I had mounted the drive in the colab notebook, still the files don't appear to be stored in google drive)
Colab stores files in some temp location which is new every time you run the notebook. If you want your data to persist across sessions you need to store it in GDrive. For that you need to map some GDrive folder in your notebook and use it as path. Also, you need to give the Colab permissions to access your GDrive
After mounting GDrive you need to move files from the Colab to GDrive using command:
!mv /content/filename /content/gdrive/My\ Drive/
I have searched through the API's but haven't been able to find a way to upload files and download files(list files) pragmatically to a shared folder (and not my own google drive). Is there a way to do this?
I'm working on an app in django that allows users to upload documents to google drive and share them with friends. The problem is I want to restrict the shared documents to view only (no download option). How can I go about doing this?
You can insert/upload files using the Drive API and set the "restricted" label to prevent downloading of the file. You would then set the appropriate permissions to this file to allow anyone or a specified set of users to access the file.
Download restrictions may or may not apply for files that are converted to one of the Google Apps formats because the option to prevent downloading seems unavailable for these files through the Google Drive UI. You would have to test this yourself.