Comments (6)
I use the onBeforeFileAdded method to observe data changes.
When data A uploads file B, there is a piece of data in files.
{key: fileA}
When data B uploads file B, under the observation of the debugger, the initial data for files is still
{key: fileA}
Later on, it became
{key: fileB}
Because the file IDs are the same
from uppy.
I'm not sure if it's possible to directly modify the value of currentFile.id in the onBeforeFileAdded method to avoid ID conflicts.
However, considering that I am using TUS for uploading large files, which may affect the breakpoint continuation function, I did not modify the ID value here.
for example: onBeforeFileAdded: (currentFile, files) => {currentFile.id = newid}
from uppy.
At present, I am directly modifying the value of ID in the onBeforeFileAdded method, which does not seem to affect subsequent functionality. I will use this method for now to solve the problem.
from uppy.
If I understand correctly, you want the same file to be uploaded to two different destinations?
from uppy.
If I understand correctly, you want the same file to be uploaded to two different destinations?
Thank you for your reply. You can understand it this way.
The main issue is duplicate file IDs.
My current solution is to reassign the generated file ID value before uploading using the onBeforeFileAdded method.
Currently, there is no issue with duplicate IDs as mentioned above.
Because I used the following code.
onBeforeFileAdded: (currentFile, files) => {
currentFile.id = `${currentFile.id}-${currentFile.source}`
}
I modified the value of the generated ID to avoid replacing the previous file with the later one when uploading the same file.
from uppy.
I think this problem should be solved on the backend. Depending on which tus server you use, there are hooks/events you could use to move the file to a different storage location. This is not something we support on the client, although you could hack it in there as you've tried.
Can you try to do this with your tus server?
from uppy.
Related Issues (20)
- Tus endpoint not being respected after initial request behind reverse proxy HOT 9
- i18n "Shared with me" etc HOT 1
- Allow streaming upload also for unknown length streams HOT 1
- @uppy/companion: include origin in dynamic customer credentials
- Using Vue2 to integrate uppy caused a strange mistake HOT 2
- aws-nodejs-example | Multipart complete api | Throws 400 bad requests. HOT 5
- title.value is not accessible inside uppy.upload in vue HOT 1
- I get this error "ResizeObserver loop completed with undelivered notifications" when I set width and height 100% in Angular HOT 5
- Uncaught TypeError: Cannot read properties of null (reading 'postMessage') in Companion's Callback Endpoint HOT 10
- Fix TypeScript sins HOT 5
- v4: typescript error for `uppy.setFileState()`
- Typescript error for 'new Uppy().use(AwsS3, {})' HOT 2
- XHR plugin expects upload response to be a valid JSON HOT 8
- companionAllowedHosts is not implemented in RemoteSources preset
- Uppy companion server error HOT 4
- Uppy 4.0.5 error HOT 5
- getTemporarySecurityCredentials() docs for S3 missing
- `Complete` event is not fired if one or more files are removed before they are uploaded using XHRUpload
- ThumbnailGenerator: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.
- Paste from clipboard support on Drag & Drop module HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uppy.