Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
solsupp
8 years agoExplorer | Level 3
Large Data Upload
Now have large data upload working, only 1 thing I cant do is share the folder. Errors on bold text, how do I get the parent shared folder ID after upload. Private Async Function ChunkUpload(path ...
Greg-DB
Dropbox Community Moderator
8 years agoFirst, to clarify when you say "Errors on bold text", do you mean you get an actual error on that 'If fileMetadata.SharingInfo.ParentSharedFolderId IsNot Nothing' line? If so, please share the full error output.
If not, do you mean that the line just doesn't return the value you expect? In that case, what is the SharingInfo value? Note that FileMetadata.SharingInfo will only be set "if this file is contained in a shared folder".
If a folder is not already shared, you need to share it using ShareFolder before you can add members.
solsupp
8 years agoExplorer | Level 3
HI Sorry for not explainging.
I am looking to get ParentSharedFolderId once the above function has completed.
I was using and was able to get ParentSharedFolderID,
old Code for smaller uploads
Dim updated As Task(Of FileMetadata) updated = dbx.Files.UploadAsync((filePath + ("/" + fileName)), WriteMode.Overwrite.Instance, body:=fs) dbx.Sharing.ShareFolderAsync(filePath, Nothing, True)
but for larger data the funtion is now async and using awaits, how can I get ParentSharedFolderID, the larger function I first mentoned above returns "instance not set to an instance of an object"
- solsupp8 years agoExplorer | Level 3
I suppose what im asking is how can I get a result from this code
Private Async Function Uploadfolder(localPath As String, remotePath As String, dbx As DropboxClient, filepath As String) As Task Const ChunkSize As Integer = 4096 * 1024 Using FileStream = File.Open(localPath, FileMode.Open, FileAccess.Read) If FileStream.Length <= ChunkSize Then Await dbx.Files.UploadAsync(remotePath, WriteMode.Overwrite.Instance, body:=FileStream) Else Await ChunkUpload(remotePath, FileStream, ChunkSize, dbx, filepath) End If End Using End Function- Greg-DB8 years ago
Dropbox Community Moderator
When you say the error was "instance not set to an instance of an object", did you actually mean "Object instance not set to an instance of an object"? (I.e., did you accidentally drop the first word from the error?)
If so, that would seem to indicate that you have a null reference. If it's coming from the line you indicated earlier, it's probably because fileMetadata or fileMetadata.SharingInfo is null. Note that FileMetadata.SharingInfo will only be set "if this file is contained in a shared folder". Make sure you check the variable before trying to access one that may be null.
If the folder you want to share is not yet shared, you can share it using ShareFolderAsync.
Anyway, UploadAsync and UploadSessionFinishAsync have the same return type (Task<FileMetadata>) so you can use them the same way. I can't provide help with Visual Basic itself, and exactly how you choose to pass data around your methods in your code is up to you of course.
- solsupp8 years agoExplorer | Level 3
Seems to be this line that returns the NULL
Dim fileMetadata As FileMetadata = Await dbx.Files.UploadSessionFinishAsync(cursor, New CommitInfo(path), memStream)
Is there any other way I can check this file has been uploaded to the shared folder in order to add folder members.
I pass the filemetadata to : in order to add folder members, this works with smaller upload, but fails with larger
dbx.Sharing.AddFolderMemberAsync(metadata.SharingInfo.ParentSharedFolderId, myMembers, False, "A Document Issue has been created by " & fnGetCompanyName() & " as you are part of the issue distribution, this ZipFile has been made available to you.")
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!