-
Notifications
You must be signed in to change notification settings - Fork 382
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
ListItemAttachments and special characters in filename #801
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
I just tried this on 2.5.0 and behavior is same as on 1.21.1 |
Hi @AJIXuMuK , The issue is because of the replace path in the below code File Refernce:- SPService.ts The replace code is present for all attachment related methods Not sure if we can remove it or not can you please help on this |
#801 updated filename replacement logic
Hi @evlo, Could you please test the latest beta version to see if the issue is fixed for you? |
@evlo this should now be fixed in the latest version. Please update to the latest version and open a new issue if the problem persists. |
Category
[ ] Enhancement
[x] Bug
[ ] Question
Version
Please specify what version of the library you are using: [1.21.1]
Expected / Desired Behavior / Question
if you attach file with name doc'-'čííčářěášý@.docx in sharepoint online name is kept
if you attach file with name doc'-'čííčářěášý@.docx using ListItemAttachments component it gets saved as doc-.docx
if you use sharepoint REST api
/_api/web/GetList(@a1)/Items(@a2)/AttachmentFiles/addUsingPath(decodedUrl=@a3)?@a1=%27%&@a2=17&@a3=%27%40%2Etxt%27
so you encode @.txt as %27%40%2Etxt%27 ieencodeURIComponent('@.txt')
it worksusing
this.getListByRelativeUrl(this._listUrl).items.getById(itemId).attachmentFiles.addMultiple
withdoc%27-%27%C4%8D%C3%AD%C3%AD%C4%8D%C3%A1%C5%99%C4%9B%C3%A1%C5%A1%C3%BD%40.docx
as filename fails but removing ' i'm able to save file with filename encoded asdoc-%C4%8D%C3%AD%C3%AD%C4%8D%C3%A1%C5%99%C4%9B%C3%A1%C5%A1%C3%BD%40.docx
at least using jsso if you escape apostrophes as %27%27 ie. doc'-'čííčářěášý@.docx becomes
doc%27%27-%27%27%C4%8D%C3%AD%C3%AD%C4%8D%C3%A1%C5%99%C4%9B%C3%A1%C5%A1%C3%BD%40.docx
it works in javascript/rest attachment methodsExpected / Desired Behavior
attachment is uploaded with special characters kept
Observed Behavior
special characters are removed from filename
related #526
Steps to Reproduce
upload file with name doc'-'čííčářěášý@.docx and any content
The text was updated successfully, but these errors were encountered: