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
Missing File Extensions #60
Comments
Hi, It's by design in the protocol. Metadata is not part of the specification and is up to the server and client to negotiate. You need to provide filename/extension as metadata and use that when reading the file. Here is an example of the filename and content type being sent as metadata: And here is how you would use it: |
Hi, It's a bit strange to have files saved without their extension and then to only add the extension when reading the file. Not possible to give the file an extension when saving based on the metadata? Having files and meta data in different places is weird but if that's how the protocol is setup I'll use it as such. Thank you |
Once again, metadata such as file extension is not part of the protocol and must be negotiated between the server and the client. Since metadata can be whatever there is no way for tusdotnet to know what the extension is and name the file accordingly. What are you trying to achieve? There is nothing preventing you from renaming the file on disk on e.g. |
Oh I see so just the transfer protocol doesn't include metadata but once you have the file you can do what you want. Got it. Thanks! |
Hi I was able to change the name of the uploaded file. I just called the File.Copy onFileCompleteAsync, but my problem is when deleting the old file, it throws exception that the file is still being used. try
|
@ronkristoff That the file is being used usually indicates that you did not dispose of the file stream after using it. Also why would you copy potentially gigabytes of data instead of just renaming the file or at the very least move it? This is a very old issue and a better solution is probably to use a custom id provider to change the id to contain the extension to avoid mucking about with the file afterwards. |
Hi,
Not sure if this is by design or if I'm doing something wrong but none of my uploaded images have file extensions once saved. Any ideas?
If I force it to open it opens the image fine so it's saving all the data just giving it a name without an extension
Thanks
The text was updated successfully, but these errors were encountered: