Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File checksum not matching after uploading with XHR #4948

Closed
2 tasks done
aashishpanta0 opened this issue Feb 22, 2024 · 4 comments
Closed
2 tasks done

File checksum not matching after uploading with XHR #4948

aashishpanta0 opened this issue Feb 22, 2024 · 4 comments
Labels

Comments

@aashishpanta0
Copy link

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

No response

Steps to reproduce

I am uploading a bunch of tiff and netcdf files using XHRUpload with Uppy. Code looks like this:

const uppy = Uppy.Core({debug: true, autoProceed: false})
    .use(Uppy.Dashboard, {
        trigger: '.UppyModalOpenerBtn',
        inline: true,
        target: '.DashboardContainer',
        replaceTargetContext: true,
        showProgressDetail: true,
        width: '100%',
        height: 470,

        showLinkToFileUploadResult: true })
    .use(Uppy.GoogleDrive, {
        target: Uppy.Dashboard,
        companionUrl: "<?php echo $server_url?>:3020"})
    .use(Uppy.XHRUpload, {
        endpoint: "<?php echo $server_url.$server_port?>/upload/uppyForm.php",
        method: 'POST',
        fieldName: 'files[]', 
        formData: true,
    });

Expected behavior

The files are uploaded and I can see them in the server. They are of the same size. The expectation is that the uploaded file checksum should also match with the checksum in the local directory.

Actual behavior

The checksum doesn't match for some of the files that are uploaded. If I upload a single file of size >500MB, the checksum doesn't match either. Any idea on what might be the issue here?

@aduh95
Copy link
Member

aduh95 commented Feb 23, 2024

Do you have more information about the changes you see on those files? Does it happen for any file or only some of them? Does it reproduce consistently, or is there some condition? Could you also share the version of the Uppy packages you are using to help us reproduce the issue.

@aashishpanta0
Copy link
Author

aashishpanta0 commented Feb 23, 2024

Hi @aduh95 The file sizes and names are not changed. But, if I try to read the file, it gives an error. So, I tried verifying the checksum for the file before and after uploading, and they donot match for those specific files.
No, there is no specific pattern. For example, If I try uploading 10 tiff files, 1 or 2 gets corrupted.
I am using: https://transloadit.edgly.net/releases/uppy/v1.13.2/uppy.min.js

Thank you

@aduh95
Copy link
Member

aduh95 commented Feb 23, 2024

Hum OK interesting. If the file size is the expected one, my hunch would be that the data might be written out-of-order. Any chance you could try uploading a big ASCII text file and share the result with us so we can validate that hypothesis? The following command should generate a roughly 1GiB file:

node -e 'for(let i=0; i < 1e8; i++) console.log(i)' > myBigTextFile.txt

Because it's ASCII, it should be much easier to understand what's happening.

@Murderlon
Copy link
Member

It would probably help to upgrade as well. You're years behind the latest version.

https://releases.transloadit.com/uppy/v3.22.2/uppy.min.mjs

@Murderlon Murderlon closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants