You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
AGreenTejada
6 years agoHelpful | Level 5
Creating Files
Hey everyone.
I'd like to use Dropbox's "Create File" feature in my API, but I didn't see the option in the SDK. Anyone able to locate it?
Thank you in advance!
- 6 years ago
The Dropbox API unfortunately doesn't offer access to those "Create new file" options, such as to create a web shortcut or new Word doc, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
Greg-DB
6 years agoDropbox Staff
The Dropbox API unfortunately doesn't offer access to those "Create new file" options, such as to create a web shortcut or new Word doc, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
- AGreenTejada6 years agoHelpful | Level 5
Hey Greg,
No problem! All I needed was a way to make a .web extension shortcut programmatically. Turns out that its a simple JSON file with the url as a variable. I remade it with a C# functions really quickly.
public static string WriteWEBExtension (string URL, string FileName) { string[] URLLines = { @"{", "\t" + ((char)34) + "url" + ((char)34) + ": " + ((char)34) + URL + ((char)34), @"}" }; string path = System.IO.Path.GetTempPath(); if (!path.EndsWith(@"\")) { path = path + @"\"; } path = path + FileName + ".web"; System.IO.File.WriteAllLines(path, URLLines); return path;
char34 is the double quotations. Hope this helps anyone else.
EDIT: OK... So this is a bit frustrating. Dropbox doesn't treat uploaded files like their own shortcuts. The end result of this is that while .web files do link to the correct URL in the windows explorer, they are treated as "editable" files on upload. If you are trying to send this file over to a friend, it won't automatically link. I've made a writer to URL extension instead.
public static string WriteWEBExtension (string URL, string FileName) { string[] URLLines = { @"[InternetShortcut]", @"IDList=", @"URL=" + URL }; string path = System.IO.Path.GetTempPath(); if (!path.EndsWith(@"\")) { path = path + @"\"; } path = path + FileName + ".url"; System.IO.File.WriteAllLines(path, URLLines); return path; }
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,918 PostsLatest Activity: 2 days ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!