Forum Discussion

gtordjman's avatar
gtordjman
Explorer | Level 3
9 years ago

Random images upload corrupt on larger batches

When uploading small png files 100KB or less some randomly get corrupted. This was not always a problem and seemes to have croppted up but none of the code was ever changed.

 

Public Async Function DropboxUpload(ByVal sql As String) As Task
Dim conn As New System.Data.SqlClient.SqlConnection(PrintQueue.ConnectionString)
Dim adpt As New System.Data.SqlClient.SqlDataAdapter(sql, conn)
Dim dt As New DataTable()
adpt.Fill(dt)
Using dbx As New DropboxClient("xxx")
Dim i As Integer
For i = 0 To dt.Rows.Count - 1

Using mem As New FileStream("\\r2d2.agslab.local\Prod_Data\RaytracerImages\ASET\final\s" & dt.Rows(i).Item("lngstoneid").ToString & ".png", FileMode.Open, FileAccess.Read)
Dim updated = Await dbx.Files.UploadAsync("/" & dt.Rows(i).Item("lngstoneid").ToString & ".png", Dropbox.Api.Files.WriteMode.Overwrite.Instance, body:=mem)
End Using
 
Next
End Using
dt.Dispose()
adpt.Dispose()
conn.Close()
conn.Dispose()
End Function

 

6 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    Thanks for the report! We'll be happy to look into this, but we could use some more information to help us reproduce this. Can you please share:

    - a sample original file (before being corrupted)
    - the output of some additional logging showing the correct contents in the mem object before upload (e.g., a hash)
    - the output of the API call for a corrupted file upload
    - a sample corrupted file

    Thanks in advance!
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    Thanks! It appears these two files only differ by two seemingly random bytes.

    If you can print the full metadata returned by the upload call, and a hash value of the returned contents of mem right before the corrupted upload, that would be helpful. Also, since it seems like this happens randomly, if you could also include the specific files for the output you share that would be useful.
  • gtordjman's avatar
    gtordjman
    Explorer | Level 3
    9 years ago

    These Hashes are MD5

     

    File1

    5/21/2017 2:01:44 PM File: 104089993044.png Hash: d89be0f0ecf34eb9c194d335c4266a68
    5/21/2017 2:01:44 PM API Return Data: Id id:vGOpbpekL5AAAAAAAAAbaA
    5/21/2017 2:01:44 PM API Return Data: ClientModified 5/21/2017 9:01:44 PM
    5/21/2017 2:01:44 PM API Return Data: ServerModified 5/21/2017 9:01:44 PM
    5/21/2017 2:01:44 PM API Return Data: Rev 36d44dd81a3a
    5/21/2017 2:01:44 PM API Return Data: Size 17492
    5/21/2017 2:01:44 PM API Return Data: MediaInfo
    5/21/2017 2:01:44 PM API Return Data: SharingInfo
    5/21/2017 2:01:44 PM API Return Data: PropertyGroups
    5/21/2017 2:01:44 PM API Return Data: HasExplicitSharedMembers
    5/21/2017 2:01:44 PM API Return Data: ContentHash d9f4df76dc2a9b03ae9f8b42cba3bdeddd99f8712a562709c6b21010f4fe842e
    5/21/2017 2:01:44 PM API Return Data: IsFile True
    5/21/2017 2:01:44 PM API Return Data: IsFolder False
    5/21/2017 2:01:44 PM API Return Data: AsFolder
    5/21/2017 2:01:44 PM API Return Data: IsDeleted False
    5/21/2017 2:01:44 PM API Return Data: AsDeleted
    5/21/2017 2:01:44 PM API Return Data: Name 104089993044.png
    5/21/2017 2:01:44 PM API Return Data: PathLower /104089993044.png
    5/21/2017 2:01:44 PM API Return Data: PathDisplay /104089993044.png
    5/21/2017 2:01:44 PM API Return Data: ParentSharedFolderId

    https://www.dropbox.com/s/g20ts7y9xmmqrzv/104089993044.png?dl=0

     

    File 2 

    5/21/2017 2:01:48 PM File: 104089993054.png Hash: 03e49852ceabec2a05b07dc98d4096ca
    5/21/2017 2:01:49 PM API Return Data: Id id:vGOpbpekL5AAAAAAAAAbbw
    5/21/2017 2:01:49 PM API Return Data: ClientModified 5/21/2017 9:01:49 PM
    5/21/2017 2:01:49 PM API Return Data: ServerModified 5/21/2017 9:01:49 PM
    5/21/2017 2:01:49 PM API Return Data: Rev 36db4dd81a3a
    5/21/2017 2:01:49 PM API Return Data: Size 18226
    5/21/2017 2:01:49 PM API Return Data: MediaInfo
    5/21/2017 2:01:49 PM API Return Data: SharingInfo
    5/21/2017 2:01:49 PM API Return Data: PropertyGroups
    5/21/2017 2:01:49 PM API Return Data: HasExplicitSharedMembers
    5/21/2017 2:01:49 PM API Return Data: ContentHash ce21d0c6e4946f8d265a6c27c6a403826ab1e619ce4b92537e4481ddf21960ac
    5/21/2017 2:01:49 PM API Return Data: IsFile True
    5/21/2017 2:01:49 PM API Return Data: IsFolder False
    5/21/2017 2:01:49 PM API Return Data: AsFolder
    5/21/2017 2:01:49 PM API Return Data: IsDeleted False
    5/21/2017 2:01:49 PM API Return Data: AsDeleted
    5/21/2017 2:01:49 PM API Return Data: Name 104089993054.png
    5/21/2017 2:01:49 PM API Return Data: PathLower /104089993054.png
    5/21/2017 2:01:49 PM API Return Data: PathDisplay /104089993054.png
    5/21/2017 2:01:49 PM API Return Data: ParentSharedFolderId

    https://www.dropbox.com/s/aks7hwao8u18shh/104089993054.png?dl=0

     

    File 3

    5/21/2017 2:01:50 PM File: 104089993056.png Hash: 158a2c4fa5fa813128d82b8b437bf351
    5/21/2017 2:01:50 PM In QR
    5/21/2017 2:01:52 PM API Return Data: Id id:vGOpbpekL5AAAAAAAAAbcQ
    5/21/2017 2:01:52 PM API Return Data: ClientModified 5/21/2017 9:01:50 PM
    5/21/2017 2:01:52 PM API Return Data: ServerModified 5/21/2017 9:01:50 PM
    5/21/2017 2:01:52 PM API Return Data: Rev 36dd4dd81a3a
    5/21/2017 2:01:52 PM API Return Data: Size 18317
    5/21/2017 2:01:53 PM API Return Data: MediaInfo
    5/21/2017 2:01:53 PM API Return Data: SharingInfo
    5/21/2017 2:01:53 PM API Return Data: PropertyGroups
    5/21/2017 2:01:53 PM API Return Data: HasExplicitSharedMembers
    5/21/2017 2:01:53 PM API Return Data: ContentHash 0be68a169fa35229a951165365562bcbfaae391849dafc9fc8817151df5f6cea
    5/21/2017 2:01:53 PM API Return Data: IsFile True
    5/21/2017 2:01:53 PM API Return Data: IsFolder False
    5/21/2017 2:01:53 PM API Return Data: AsFolder
    5/21/2017 2:01:53 PM API Return Data: IsDeleted False
    5/21/2017 2:01:53 PM API Return Data: AsDeleted
    5/21/2017 2:01:53 PM API Return Data: Name 104089993056.png
    5/21/2017 2:01:53 PM API Return Data: PathLower /104089993056.png
    5/21/2017 2:01:53 PM API Return Data: PathDisplay /104089993056.png
    5/21/2017 2:01:53 PM API Return Data: ParentSharedFolderId

    https://www.dropbox.com/s/fkdy7lps4b0umkx/104089993056.png?dl=0

  • gtordjman's avatar
    gtordjman
    Explorer | Level 3
    9 years ago

    I actually found the problem. It has to do with our sonicwall, a setting was changed earlier this year where the sonicwall issues an SSL certificate to each client and makes the secured connection outside of our network so traffic could be monitored (DPI-SSL). I added dropbox to the exclusions list and now it seems to be working.

     

    Thanks

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    Thanks for following up. I'm glad to hear you got this sorted out.

About Dropbox API Support & Feedback

Node avatar for 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!