lose characters when upload files contain UTF-8 names - linux

When I try to upload some files with names in UTF-8 to server. It seems that several characters is cut off. For example, Đề thi đẫm máu is stored as thi đẫm máu (Đề is lost). I also try creating new UTF-8 filenames on system. And some errors occur that those files can't be deleted or opened. (i.e. indexá.php)
I found that this file is stored correctly in root. So it could be an error of display on admin control panel.
How could I fixed this?

Related

special character single quote (') does not upload

I am uploading values with the following code
$pnp.sp.web.getFolderById(targetFolderUniqueId).files.add(fileName, file, _shouldOverwrite)
When I upload a filename like
'add from existing site columns'.png
it obviously fails. I have been able to work around this in the past with escaping the single quotes with %27, which gives me
%27add from existing site columns%27.png
and encodeURI to get
%27add%20from%20existing%20site%20columns%27.png
Uploads the file great, and it converts the characters back in sharepoint 2016 so the file displays
'add from existing site columns'
on the screen. However, if I upload in 2019 it displays the file without replacing the single quotes.
what the file looks like on sharepoint page
I was wondering if Sharepoint 2019 handles special characters in a different way? Is there anyway to get filenames to decode ALL special characters when adding to a sharepoint folder in 2019?

Updating "text connection" path using provided string and preserve text to column settings

I have an Excel file with several sheets connected to many external csv files. This has worked fine for now working on my own, but now I'd like to be able to move the Excel file and/or csv files, or hand them off to someone else, and not break the connections.
The method here works for updating the file name based on a provided string:
Editing "text connection" paths
...but it doesn't preserve the text to columns settings after updating the path. Since I'm dealing with csvs, I need the import to come in as comma delimited. Since I'm dealing with a lot of connections in a single file, I'd also like to be able to let the user define a single path somewhere, and have it automatically use that path to find the files.

.mht file looking for local resources

I'm auto-generating .doc files (.mht really) according to this tutorial.
Generated files work great locally but not on other computers as the file is requesting the header to be loaded from my local path instead of using the base64 version that is embedded. The main content is loading fine. Here's the generated file.
I can't find the reason for this behaviour. Any suggestions appreciated.
EDIT
Turned out that the problem was caused by unnecessary carriage return and line feed characters at the beginning of my base64 strings.

Zip file with .csv extention lost somewhere in filesystem

The file is also locked with winzip and I cant remember the name or directory, I hid it in a very obscure directory. Could be in the windows system files could be in a program directory file. I did a search for all .CSV files I have 4-5K to go through. Any suggestions on how this could be done?
I was opening up files in batches by highlighting a bunch that pressing edit with notepad plus plus. Than going through each one. I know once the file is opened in notepad plus it will not show any words. It is pictures. I own an eCommerce site and I have my master copies that I bought $X,XXX and did not want to take any chances in them be found and resold by other people on my network. Any suggestions?
Opening any zip file in a hex editor suggests that every zip file starts with a data of PK. We can use it in our favour. :)
Download this software: EditPad Pro
What this software does is, it recurses through the whole filesystem starting from a specified base folder to search for any string residing in any of the child files, they maybe Text or Binary, it treats them the same, thus giving accurate results.
In our case, it's a regex: ^PK
When you'll execute this search, the software will return all the files that start with data PK, make sure you do a casesensitive search.

How to force excel not to drop rows when opening csv-file?

Background:
We have a web application where the user can export orders in csv-format. For users with Microsoft Excel installed it's the default program. They simply click 'Open' after the file is downloaded. Users mainly use Internet Explorer, Firefox and Chrome. No difference in behaviour.
The problem:
If the user just open the csv-file (from browser or explorer) the file is opened by Excel and data is loaded automagically. But sometimes rows are just missing. Gone. No exception, no message, nothing.
The data is there, if you open the file with notepad you'll see it.
(I suspect it has something to do with special chars, quotes, commas etc but I can't find a root cause for this)
How to make it work:
If you save the file to disk, open excel and selects File -> Open -> Format: Textfiles (*.prn, *.txt, *.csv, *.skv) -> Open excel will launch a import wizard and everything will work perfectly.
Is there anything I can do with the export-file to either force the Import Wizard or just tell Excel not to exclude our critical order information without warning?
I think I've found the cause of this. It seems to be due to regional settings as described in this post and sugesstions from superuser.com
I solved it by wrapping all fields except numbers with quotes and now it works just fine.
Make sure that you use a consistent delimiter scheme across all lines in the file. For example, check if you have both \n and \r\n sequences as line delimiters.

Resources