rejetto forum

FHFS having issues with special characters in file names

0 Members and 1 Guest are viewing this topic.

Offline JGraceffo

  • Occasional poster
  • *
    • Posts: 11
    • View Profile
Hello, I've been working with FHFS for a fair bit now and it's been great but we've been noticing some links that we were sending to people were giving a 404 file not found error.

I dug a little deeper yesterday and found that this was happening only with files with a "#" in their name.  I didn't test any other special characters because our file names don't contain any, but I was wondering if anyone had a fix or workaround (besides renaming files).

Thanks in advance for any help!


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 901
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
i don't use FHFS, but if you need a quick and easy way to rename files, here is a free open source program that can help

http://www.den4b.com/?x=products&product=renamer

it called renamer, you point to a directy, and ad rules to name the files, a preview will apear donw below to what the files are called...
Files i try to keep and share can be found on my google drive:

https://drive.google.com/drive/folders/1FOWi3Gqaldld6JLXvZ-biDv4RSguf0IC


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 711
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
i don't use FHFS, but if you need a quick and easy way to rename files, here is a free open source program that can help
Thanks for sharing that, but ReNamer is not Open Source, it's freeware at least (in his Lite edition, but it's normally a paid application). Thanks anyway.....
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline raybob

  • Moderator
  • Tireless poster
  • *****
    • Posts: 453
    • View Profile
    • FileSplat.com
It's well known that HFS itself can't handle Unicode, and there's nothing I can do about that.  As for the # character, it doesn't work because that's a character with special meaning in URLs.  FHFS doesn't do anything to change it so your browser misinterprets the URL when it tries to get files with the # character.  I suppose you can try taking the URL and replacing # with %23 and see if it works.


Offline JGraceffo

  • Occasional poster
  • *
    • Posts: 11
    • View Profile
Interesting, would it be possible to change the "generate random url's (for public uploads)" option in FHFS so that it doesn't append the filename to the end of the randomly generated url? That way we could avoid the # in URLs.

...and HFS doesn't like unicode either? That's a pain, but I suppose we could rename files we want to send.  Thanks for the help, if you happen to think of a workaround or anything else, you can pm me whenever!
« Last Edit: May 09, 2014, 06:05:05 PM by JGraceffo »


Offline JeremyB796

  • Occasional poster
  • *
    • Posts: 15
    • View Profile
This is actually a big issue I'm having-
I use FHFS as a public server for some people...because it's the only thing I have found so far that works.

Most users look to be having an issue with unicode characters, most of them being japanese.
I Personally have no issues with file such as this, but others are when they try to re-download their files...odd

I have the PC set to japanese for non-unicode software, not sure if that does anything, I had it set like that for other software that requires the japanese locale to run...
« Last Edit: May 09, 2014, 05:24:38 PM by JeremyB796 »


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 901
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
okay, i see the isue now, as if the file was named and saved, there are certain chacters that are not allowed in the name space. This is due to the code runing behinds sceens to make the aplications work:

The # in html broswers when it is read stps the load sequence at that last directory and will contiune to laod that director...
There are many "illegal" chacters that wil intrurpet url path reading which intourns stops actula paths to files.

One of these issues is a known problem with hfs and unicode, other issues are the brtowser and web paths you are using to acess the file. in the end, you will have to look up the "illegal" chacters that will not work and follow the (URI)!

-------------
A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource. This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet. The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier.
-----------

http://perishablepress.com/stop-using-unsafe-characters-in-urls/
Files i try to keep and share can be found on my google drive:

https://drive.google.com/drive/folders/1FOWi3Gqaldld6JLXvZ-biDv4RSguf0IC


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 901
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link

Character Encoding Chart

To help promote the cause of Web Standards and adhering to specifications, here is a quick reference chart explaining which characters are “safe” and which characters should be encoded in URLs.

Classification   Included characters   Encoding required?
Safe characters   Alphanumerics [0-9a-zA-Z], special characters $-_.+!*'(), and reserved characters used for their reserved purposes (e.g., question mark used to denote a query string)   NO
ASCII Control characters   Includes the ISO-8859-1 (ISO-Latin) character ranges 00-1F hex (0-31 decimal) and 7F (127 decimal.)   YES
Non-ASCII characters   Includes the entire “top half” of the ISO-Latin set 80-FF hex (128-255 decimal.)   YES
Reserved characters   $ & + , / : ; = ? @ (not including blank space)   YES*
Unsafe characters   Includes the blank/empty space and " < > # % { } | \ ^ ~ [ ] `   YES
* Note: Reserved characters only need encoding when not used for their defined, reserved purposes.

Usafe Characters

More about “unsafe” characters from RFC1738:

Characters can be unsafe for a number of reasons. The space character is unsafe because significant spaces may disappear and insignificant spaces may be introduced when URLs are transcribed or typeset or subjected to the treatment of word-processing programs. The characters “<” and “>” are unsafe because they are used as the delimiters around URLs in free text; the quote mark (“"”) is used to delimit URLs in some systems. The character “#” is unsafe and should always be encoded because it is used in World Wide Web and in other systems to delimit a URL from a fragment/anchor identifier that might follow it. The character “%” is unsafe because it is used for encodings of other characters. Other characters are unsafe because gateways and other transport agents are known to sometimes modify such characters. These characters are “{”, “}”, “|”, “\”, “^”, “~”, “[”, “]”, and “`”.

All unsafe characters must always be encoded within a URL. For example, the character “#” must be encoded within URLs even in systems that do not normally deal with fragment or anchor identifiers, so that if the URL is copied into another system that does use them, it will not be necessary to change the URL encoding.
Files i try to keep and share can be found on my google drive:

https://drive.google.com/drive/folders/1FOWi3Gqaldld6JLXvZ-biDv4RSguf0IC


Offline raybob

  • Moderator
  • Tireless poster
  • *****
    • Posts: 453
    • View Profile
    • FileSplat.com