Comments (6)
The reason why the tusd server generates random IDs for uploads instead of using the file's name is that the protocol (see http://tus.io) does not force the client to tell the server the file name. This is a decision that has been made on purpose. However, we do understand that such information is sometimes crucial and therefore you are able to use the mechanics of meta data to pass it along. In this case the file name will be presented as meta data inside the .info
object.
To add the file name using our Android/Java client, you have to use the TusUpload#setMetadata
method and pass it a map containing the information. Right now, this is not automatically done but I will enable to by default ASAP.
from tusd.
Right now, this is not automatically done but I will enable to by default ASAP.
The code for this change is already in the Android and Java repositories and will be released very soon.
from tusd.
Thanks a lot. Latest commits of client sides are work now.
By the way, although current sample code can solve the problem of original uploaded file name by fetching from the .info file. But the performance and efficiency is not good for production because of the file I/O operating for reading the .info file.
It will be good if the file extension name stored in the server is same as uploaded file. (e.g. uploaded file extension name is .png and server stored file extension name is .png [currently is .bin])
from tusd.
But the performance and efficiency is not good for production because of the file I/O operating for reading the .info file.
Please explain this thought more. You need a place to save the additional information about the upload and this is exactly why we need it. We cannot simply remove it. Also, if you have bigger uploads, the impact of reading this small file is negligible IMO.
It will be good if the file extension name stored in the server is same as uploaded file. (e.g. uploaded file extension name is .png and server stored file extension name is .png [currently is .bin])
As I said, we must not assume that we have a file name available and therefore cannot use the "original" extension. In addition, this would make the file handling logic more complex without providing much benefit to tusd or am I missing something?
from tusd.
It will be good if the file extension name stored in the server is same as uploaded file. (e.g. uploaded file extension name is .png and server stored file extension name is .png [currently is .bin])
As I said, we must not assume that we have a file name available and therefore cannot use the "original" extension. In addition, this would make the file handling logic more complex without providing much benefit to tusd or am I missing something?
I agree with you. It may a good viewpoint for a protocol and sample code of keeping the file handing logic simple. The file handling logic can be implemented by another agent or API written by whom wants to do further applications.
But the performance and efficiency is not good for production because of the file I/O operating for reading the .info file.
Please explain this thought more. You need a place to save the additional information about the upload and this is exactly why we need it. We cannot simply remove it. Also, if you have bigger uploads, the impact of reading this small file is negligible IMO.
It's not my mean to remove the .info file. In my original simple thoughts, the original file name can be as full or partial of new file name in the server. It will be more efficient without reading the .info file to get the original file name in the server side. It just a simple thoughts. Current implementations and sample codes I think is enough for further applications.
from tusd.
I agree with you.
👍
It's not my mean to remove the .info file. In my original simple thoughts, the original file name can be as full or partial of new file name in the server. It will be more efficient without reading the .info file to get the original file name in the server side. It just a simple thoughts.
That's a good use case but a very specialized one. In general, I think, people will need more information than just the original file name and therefore have to read the additional data anyway. So I am sorry, but your suggestion won't make it into tusd.
from tusd.
Related Issues (20)
- Allow stopping uploads in PatchRequest before any data is passed to the store HOT 3
- handler: support HTTP range requests in GET /:upload HOT 3
- Support RUFH draft-01 and -02
- S3 backend with TUS handler fails to handle PATCH HOT 10
- Keep old metadata after modifying it in pre-create hook HOT 1
- S3 Storage GetReader Range Support HOT 1
- Uniform Termination Process for Store Implementations: Ensuring Consistent Removal of Binary and .info Files HOT 1
- Cleaning up .info files HOT 3
- s3store: Experiment with optimistic part uploads to S3 HOT 2
- Tus returning http in initial response causing redirect to https to strip authorization headers HOT 3
- docs: Add developing and contributing guide
- docs: Add example usage with Minio and Azurite
- Many post-receive hooks after post-finish hook HOT 3
- Unable to fetch Upload Id from Path HOT 1
- cli: Option log-format=json is ignored for plugin logs HOT 1
- using tusd handler with gorilla mux causing "NetworkControlError" warnings HOT 10
- Given nginx configuration slows down uploads over https HOT 1
- NetworkControlError/NetworkTimeoutError "feature not supported" in logs HOT 1
- Mismatched offset caused by duplicate part name with old file use s3store.
- Unclear if filelocker has to be used with filestore HOT 7
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 tusd.