Is there a way to check if a file/folder in Dropbox has a shared link without creating one? - dropbox

We want to use the Dropbox REST API to check if a file/folder has a shared link, and if so what permissions it has (e.g. is it password protected).
The only relevant API call seems to be /shares, which creates a public shared link if no shared link already exists. Calling it with the GET http verb also has the side effect.
Is there a way to check the shared link status without changing it?

No, it's not currently possible to just get shared link status/metadata like this on the Dropbox API, but we're tracking this as a feature request.

Related

URL to S3 file in private bucket

I've uploaded a file using the SDK to my private S3 bucket.
I can access this file through the S3 UI.
However, I cannot access this file through a direct link. It gives me some XML that includes "AccessDenied" as a code and message.
It seems reasonable that since I'm authenticated in the browser and am clicking on a direct link to the file from the same browser, that I should be allowed through. At the very least, I should be directed to a login page.
Does anyone have any experience with this?
So after working on this for a bit, I discovered the best thing is to simply publish the console URL to the file.
https://s3.console.aws.amazon.com/s3/object/{your bucket}/{your file path}?region={the region of your bucket}&tab=overview
Be mindful to specify the correct region. If you're forming this programmatically, then use Amazon.RegionEndpoint.SystemName.
If you're not logged in, it will ask you for your login!
No signed URL is necessary.
Thanks to everyone who contributed!
There are 2 places that you need to make sure are set correctly based on how you want to setup access to the bucket. It will either have public or private access.
The properties tab:
Here you can set what you will use the bucket for.
The Permissions tab -> Bucket Policy:
With this, you can then setup access. I was able to generate a policy with this site:
http://awspolicygen.s3.amazonaws.com/policygen.html
EDIT:
Mine is working with the settings I have shown. I recommend asking the AWS boards if to get to the bottom of it. You could also try this:
You can use the direct link if you are inside a VPC. You have to :
1- Create a VPC endpoint for Amazon S3.
2- Add a bucket policy that allows access from the VPC endpoint.
All steps are described in the following link :
https://aws.amazon.com/premiumsupport/knowledge-center/s3-private-connection-no-authentication/?nc1=h_ls

Unable to access shared folder in one drive for business

We are building an application using onedrive api v2.0.
But we are unable to see/access folders which are shared to user by any other users while making a request to /me/drive/root/children.
Can someone please suggest how to access folders which are shared by someone as our api will further create folders, files in these shared folder.
Shared files don't show up in the user's drive (/me/drive/root in your example) but are available through the sharedWithMe view:
GET /drive/sharedWithMe
This returns a collection of items that have been shared with the owner of the drive (or the current user in this case). Each item returned will include the remoteItem property which contains a reference to the actual item. If you want to access the actual item, then you need to build a request like this:
GET /drives/{item.remoteItem.parentReference.driveId}/items/{item.remoteItem.id}
Which will access the actual shared item (not the link to the remote item which is returned by sharedWithMe).
There's more information about Shared With Me on the OneDrive dev portal.
The request which was specified by greg works fine. I don't about the scopes specified by gregg, but to access the shared files, you to add the current user through you are making the as secondary administrator to other user ( in this case the user who shared the file) in SharePoint MySite administration.
I suggest to use graph API for accessing files from one drive as the responses are more consistent compared to the response from onedrive api. Though both Ali's require the secondary administrator setting to access the files.

Dropbox HTTP API v2 overwrite files when moving them

I'm using the /files/move endpoint on Dropbox API v2, but getting the error that a file of the same name exists in the destination directory (which it does).
How can I set the HTTP request to simply override the existing file with the file being moved?
I just got confirmation from Dropbox that overwrite is not possible for the /files/move endpoint (at this time).
The API doesn't currently offer mode options like this (e.g., to force an overwrite) for the copy and move endpoints, so you'll need to delete the existing file first. We'll consider this a feature request though.

Get Dropbox public folder's metadata without authentication

I'm about to create a blog and wanted to host the content on Dropbox (only Markdown files, everything else is on my server) because I want to be able to quickly upload and edit posts from all my devices without having to get some FTP app on them.
So far I managed to access files via https://dl.dropboxusercontent.com/u/********/<sub-folder>/<file name>.md and like pointed out here I can get the last-modified attribute via etags.
However, I'm stuck at getting a file list (or a folder's metadata in general). Is this possible without using OAuth?
No, this isn't possible without using the API. But why are you against using the API?
Feel free to use my tool https://dbxoauth2.site44.com/ to get an OAuth access token for your account. Then just do an HTTP GET to https://api.dropbox.com/1/metadata/auto/<path> with an Authorization header of Bearer <token>. Ditto for getting the actual file contents, just use /files/auto/<path> instead.
Oh, unless you're doing this client-side in JavaScript? In that case, this won't work since you can't give your access token out to the client (where it could be abused by anyone who visited your website).
make "Public" folder and go https://www.dropbox.com/enable_public_folder
back to your dropbox folder (web) right mouse at file in public folder and chose "Copy public link..."
Update: As of September 1, 2017 public links have been disabled for all users.
https://help.dropbox.com/files-folders/share/public-folder

Getting a pre-authenticated URL to an S3 bucket

I am attempting to use an S3 bucket as a deployment location for an internal, auto-updating application's files. It would be the location where the new version's files are dumped for the application to puck up on an update. Since this is an internal application, I was hoping to have the URL be private, but to be able to access it using only a URL. I was hoping to look into using third party auto updating software, which means I can't use the Amazon API to access it.
Does anyone know a way to get a URL to a private bucket on S3?
You probably want to use one of the available AWS Software Development Kits (SDKs), which all implement the respective methods to generate these URLs by means of the GetPreSignedURL() method (e.g. Java: generatePresignedUrl(), C#: GetPreSignedURL()):
The GetPreSignedURL operations creates a signed http request. Query
string authentication is useful for giving HTTP or browser access to
resources that would normally require authentication. When using query
string authentication, you create a query, specify an expiration time
for the query, sign it with your signature, place the data in an HTTP
request, and distribute the request to a user or embed the request in
a web page. A PreSigned URL can be generated for GET, PUT and HEAD
operations on your bucket, keys, and versions.
There are a couple of related questions already and e.g. Why is my S3 pre-signed request invalid when I set a response header override that contains a “+”? contains a working sample in C# (aside from the content type issue Ragesh is experiencing of course).
Good luck!