I had my website hosted on a Google Drive public folder based on the following post: http://googleappsdeveloper.blogspot.com/2012/11/announcing-google-drive-site-publishing.html
Sample website:
https://googledrive.com/host/0B716ywBKT84AcHZfMWgtNk5aeXM
Now the problem is a link to the root folder displays all the files on my public folder. I know I can prevent it by adding an index.html file to my public folder to replace the listing, but my folder contents are still accessible through the following URL:
https://drive.google.com/folderview?id=FOLDER-ID&usp=sharing
You can even access them by signing in to your own Google account and navigating to the following page:
https://drive.google.com/#folders/FOLDER-ID
In comparison, on a public folder/subfolder on Dropbox each individual file is publicly available, but the root directory listing is denied.
Examples:
Folder: https://dl.dropboxusercontent.com/u/4017788/logo.png
Subfolder: https://dl.dropboxusercontent.com/u/4017788/Labs/image1.jpg
How can I achieve the same functionality on a Google Drive public folder?
Thanks!
The ACL semantics of Drive is quite different than Dropbox's sharing. In order to make a folder publishable you need to at least give read access to public, meaning once your directory ID is known, it could be listed via the front-end and the API.
In the longer term, we can restrict the listings by not listing children files shared with public but only with those who knows the link.
Related
I am building a simple public website that will allow users to search and view various PDF files. I plan to store the PDF files on a public folder in my Google Drive. The link to my test folder is:
https://drive.google.com/open?id=1pBTWzuElA-gSLPvQAHlnonamfon6V1NW
In this folder there are 2 PDF files - File1.PDF and File2.PDF
I would like to be able to link to these from an HTML page but have no idea how to do it - I have searched this forum but with no luck so far - the closest I have found is how to download files from gdrive via a local program rather than a public website
Drive has its own api that you could use here
Hope this help
I have a bunch of html files in my drive and I want to be able to preview them without downloading them to local. I also don't want to create a public folder and store them there. Basically I want the files to be only visible to me and to people whom I share with. Is it possible?
I don't have to necessarily view the pages in the drive.google.com, it's ok to be a url which has to be accessed outside of drive.google.com, and I can bookmark that url to visit the html files and send the link to authorized people.
I came across this solution in SO but it suggests to create a public folder.
opening html from google drive
I'm trying to create script to download all files from another user shared folder in google drive using rest api. If i'm right, there are two variants:
Using drive.children.list, with folder ID
Using drive.files.list, with search query like 'FOLDER_ID in parents'
But both of this variants returning only files which were once opened by my google account in browser. If I open file in browser - this file will appear in results of API calls.
Folder is shared for anyone, who has link.
Where is the problem, how I can list all files in folder?
Since you did not give us any info about the SCOPE, I am wild-guessing that it may be your problem. You probably have FILE scope, instead of DRIVE.
Also, I would recommend to test these things with 'TryIt!' here. You can quickly modify both scopes and queries there.
Good Luck
This is a bug/quirk in the Drive API, though there is an easy workaround. If you call files.update with 'addParents=root' it'll add the shared folder under 'My Drive'. This has the effect of making the files part of your corpus and they'll appear in results.
Is it possible to upload files to a cloud storage folder for which I have only the shared link with edit permissions? I want to do this from my application, from code, so I'm interested in an API. I've looked into SkyDrive, GoogleDrive and DropBox APIs but I can't find a solution for this scenario in the API references.
It's fine if I have to sign in through the API with a user account to be able to upload the files to the shared link but I need to allow any user that has the link to upload files to that location.
Have I missed anything in the above mentioned APIs or are there any other cloud storage services which supply a solution for my needs?
Yes it is possible.
These are the steps I just took to verify.
User-A creates a folder called 'shared folder'
User-A makes that folder publicly writeable
User-A passes the shared URL to User-B. The key part of the URL is the id=1bxxxxxxx
User-B goes to https://developers.google.com/drive/v2/reference/files/insert#try-it
... where he authenticates himself
... creates a request body containing parent: "id_from_step_3"
... Executes the upload
The result is that User-B has created a file in the folder 'shared folder'
I think you have got your self in a tangle.
Through a shared URL
When someone gives you a URL to view and indeed edit a file that is purely for that file. You can't therefore upload files that way. You can share folders however very easily. https://support.google.com/drive/answer/2494822?hl=en https://www.dropbox.com/help/19/en
As for the API directly I can't really help you I am affraid
I'm trying to integrate Dropbox into my web application in the following way:
Users can enter a Dropbox Share Link, i.e. a Dropbox folder that can be accessed by anyone, even without a dropbox account.
My application then grabs the images from the folder and displays them to all users of my application.
Now as far as I can tell, the Dropbox API doesn't allow this without sending the user through a full-blown OAuth process. But since the shared link is public anyway, I don't need (and don't want) access to the users Dropbox account.
Is there a way to access a shared link in a programmatic way (without parsing the DOM or similar hacks)? Maybe there is a query parameter on the shared link to retrieve the contents as JSON? If it exists, I didn't find any docs about it.
Surely I'm not the first one to try this, so please share your solutions!
No, there's no programmatic way to list folder contents from a share link. If you have a share link for a specific file, then you can convert the domain from www.dropbox.com to dl.dropboxusercontent.com, but this trick doesn't work on folders.