Coder Social home page Coder Social logo

Comments (10)

kukhariev avatar kukhariev commented on July 20, 2024 1

server must respond with code 201 to the post request.

https://github.com/senolatac/chunk-upload/blob/f6567d2fef27b1199c5d4ddd823d58a52e48a331/file-uploader-server/src/main/java/com/sha/fileuploader/controller/FileUploaderController.java#L104

Probably should:

ServletUtil.createLocation("ngx-upload/"+metadata.getUniqueId()), HttpStatus.CREATED);

from ngx-uploadx.

kukhariev avatar kukhariev commented on July 20, 2024 1

send chunk: 2
...
HTTP/1.1 308 Resume Incomplete
Range: bytes=2097152-4194303 - error here, should be Range: bytes=0-4194303
Content-Length: 0

from ngx-uploadx.

kukhariev avatar kukhariev commented on July 20, 2024 1

LocalStorage -> UPLOADX-V3.0-xxx key.

I'll do a less restrictive range check.

from ngx-uploadx.

kukhariev avatar kukhariev commented on July 20, 2024 1

the file is hashed twice before and after upload. And the hash is not checked on the server. I don't think that's very good.

It's possible to do that:

async sendFileContent(): Promise<number | undefined> {
 const { end, body } = this.getChunk();
 const chunkHash = await this.hasher.hash(body);
 const headers = {
   'Content-Type': 'application/octet-stream',
   'Content-Range': `bytes ${this.offset}-${end - 1}/${this.size}`,
   'Chunk-md5': chunkHash
 };
 await this.request({ method: 'PUT', body, headers });
 return this.getOffsetFromResponse();
}

from ngx-uploadx.

attachai-b avatar attachai-b commented on July 20, 2024

When i change HttpStatus to CREATED

i can post Upload file

but not put file

image: https://s3-ap-southeast-1.amazonaws.com/img-in-th/49ef3549f41be39385a1d65af829d4de.png

from ngx-uploadx.

attachai-b avatar attachai-b commented on July 20, 2024

REQUESTS OVERVIEW

  • create:
POST http://localhost:8000/upload-file
Content-Type: application/json; charset=UTF-8
X-Upload-Content-Length: 13057291
X-Upload-Content-Type: video/mp4

{"name":"file.MP4","mimeType":"video/mp4","size":13057291,"lastModified":1547276404709,"uploadId":"8d03d7e3"}
HTTP/1.1 201 Created
Location: upload-file/f38b082c-dbc6-4f8c-bb47-e9acb1a5338a
Content-Length: 0
  • send chunk: 1
PUT http://localhost:8000/upload-file/f38b082c-dbc6-4f8c-bb47-e9acb1a5338a
Content-Type: application/octet-stream
Content-Range: bytes 0-2097151/13057291
Content-Length: 2097152

[BYTES 0-2097151]
HTTP/1.1 308 Resume Incomplete
Range: bytes=0-2097151
Content-Length: 0
  • send chunk: 2
PUT http://localhost:8000/upload-file/f38b082c-dbc6-4f8c-bb47-e9acb1a5338a
Content-Type: application/octet-stream
Content-Range: bytes 2097152-4194303/13057291
Content-Length: 2097152

[BYTES 2097152-4194303]
HTTP/1.1 308 Resume Incomplete
Range: bytes=2097152-4194303
Content-Length: 0

But !!!

  • send chunk: 3
PUT http://localhost:8000/upload-file/f38b082c-dbc6-4f8c-bb47-e9acb1a5338a
Content-Type: application/octet-stream
**Content-Range: bytes 0-2097151/13057291**
Content-Length: 2097152

[BYTES 0-2097151]
HTTP/1.1 308 Resume Incomplete
**Range: bytes=0-2097151**
Content-Length: 0

from ngx-uploadx.

attachai-b avatar attachai-b commented on July 20, 2024

I'm stamp log in database

image : https://s3-ap-southeast-1.amazonaws.com/img-in-th/d8cd5034a7f1bff27b7766626d6661a5.png

from ngx-uploadx.

attachai-b avatar attachai-b commented on July 20, 2024

Some file upload error because send Content-Range: bytes */3000,

How do I clear the cache of files that I uploaded?

from ngx-uploadx.

attachai-b avatar attachai-b commented on July 20, 2024

I would like a sample (back-end java spring-boot) about file integration. When all uploads are complete,

in code filer.component.ts line 104-115,

Do I need to create an hash? (gen hash, send hash to back-end)

Reference: https://github.com/senolatac/chunk-upload/blob/develop/file-uploader-client/src/app/filer/filer.component.ts

Or if you can't answer me, that's okay.
I understand that you made for Angular.

from ngx-uploadx.

attachai-b avatar attachai-b commented on July 20, 2024

Thank you very much,
I can now make my program upload chuck files and merge files.

from ngx-uploadx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.