You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect to see the filename 'myFile' in the browser under the media details, but I see 'myFil'.
Oddly enough in the media collection view I do see the correct filename.
I also see the correct filename in the request under the originalFilename key.
Please see screenshots.
Screenshots
Filename with last character removed
Filename showing as specified
Correct name in the request under the originalFile key
Which versions of Sanity are you using?
"@sanity/client": "^3.4.1"
What operating system are you using?
Mac OS Monterey 12.1
Which versions of Node.js / npm are you running?
8.19.3
v16.19.0
The text was updated successfully, but these errors were encountered:
rexxars
added a commit
to sanity-io/sanity-plugin-media
that referenced
this issue
Feb 1, 2023
Fixessanity-io/client#98
If a file is uploaded with an original filename that does not include an extension (`.png` or similar), the `getFilenameWithoutExtension` method will remove the last character of the filename, because it uses the last index of `.`, which is not found, resulting in `-1`.
* fix: prevent removal of last character on no filename extension
Fixessanity-io/client#98
If a file is uploaded with an original filename that does not include an extension (`.png` or similar), the `getFilenameWithoutExtension` method will remove the last character of the filename, because it uses the last index of `.`, which is not found, resulting in `-1`.
* fix: simplify filename inputs, trim before validation
---------
Co-authored-by: Robin Pyon <[email protected]>
Describe the bug
Trying to upload an image asset with a filename specified always results in the last character of the filename being removed in the browser.
To Reproduce
Upload an image using
Sanity.client.upload()
Expected behavior
I expect to see the filename 'myFile' in the browser under the media details, but I see 'myFil'.
Oddly enough in the media collection view I do see the correct filename.
I also see the correct filename in the request under the
originalFilename
key.Please see screenshots.
Screenshots
![Screen Shot 2023-02-01 at 1 00 46 PM](https://user-images.githubusercontent.com/48231024/216125233-c1d2703f-2c09-49a1-bc24-8698f6ea1a41.png)
Filename with last character removed
Filename showing as specified
![Screen Shot 2023-02-01 at 1 03 54 PM](https://user-images.githubusercontent.com/48231024/216125893-492c02c9-8664-41ac-81a5-1499976e3f2d.png)
Correct name in the request under the originalFile key
![Screen Shot 2023-02-01 at 1 06 17 PM](https://user-images.githubusercontent.com/48231024/216126331-1c2c0c47-a1e3-47ae-a1a4-ccdc0662e6bb.png)
Which versions of Sanity are you using?
"@sanity/client": "^3.4.1"
What operating system are you using?
Mac OS Monterey 12.1
Which versions of Node.js / npm are you running?
8.19.3
v16.19.0
The text was updated successfully, but these errors were encountered: