We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
solsupp
7 years agoExplorer | Level 3
Generate folder link manually
I wish to send uploaded folder links to potential folder members manually, via my own constructed email, is this possible. Also will I still have to add folder members using "AddFolderMemberAsync...
solsupp
7 years agoExplorer | Level 3
If I upload a file and say the same file exists, can I overwrite what is currently there, at the minute I get an exception pretty much saying the file already exists.
Greg-DB
Dropbox Community Moderator
7 years agoYes, you can control what happens when uploading to a path where a file already exists by specifying a particular WriteMode, e.g., to the `mode` parameter for UploadAsync. Please refer to those documentation pages for more information (and be sure to review the `autorename` parameter as well).
- solsupp7 years agoExplorer | Level 3
Yep, I have that set to WriteMode.Overwrite.Instance, what about larger files?
I am using :
Private Async Function ChunkUploadAndCreateEmail(path As [String], stream As FileStream, chunkSize As Integer, dbx As DropboxClient, filepath As String) As Task Dim numChunks As Integer = CInt(Math.Ceiling(CDbl(stream.Length) / chunkSize)) Dim buffer As Byte() = New Byte(chunkSize - 1) {} Dim sessionId As String = Nothing For idx = 0 To numChunks - 1 Dim byteRead = stream.Read(buffer, 0, chunkSize) Using memStream = New MemoryStream(buffer, 0, byteRead) If idx = 0 Then Dim result = Await dbx.Files.UploadSessionStartAsync(False, memStream) sessionId = result.SessionId Else Dim cursor = New UploadSessionCursor(sessionId, CULng(CUInt(chunkSize) * CUInt(idx))) If idx = numChunks - 1 Then Dim fileMetadata As FileMetadata = Await dbx.Files.UploadSessionFinishAsync(cursor, New CommitInfo(path), memStream) Else Await dbx.Files.UploadSessionAppendV2Async(cursor, False, memStream) End If End If End Using Next End Function- Greg-DB7 years ago
Dropbox Community Moderator
When using upload sessions to upload larger files, you can likewise specify the WriteMode in the CommitInfo you pass to UploadSessionFinishAsync using CommitInfo.Mode.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!