Forum Suggestion: Image File Name requirements disclaimer

aluminum's picture

I spent about 15 minutes trying to upload an image before I realized it was probably the file name. I stripped out punctuation and spaces and then it uploaded.

I assume there are some restrictions with the filenames for image uploading. I'd suggest putting a disclaimer/note next to the UPLOAD IMAGE link.

Jan's picture

It has all been covered *here*.

aluminum's picture

It's covered there but unless you take the time to hunt down the thread and scroll through the replies, it's not so obvious. I have a hunch most folks don't take the time to do that.

I'm thinking a one-line addition to the post page:

* image file names should not contain spaces or the following characters: (listed here)

blank's picture

You shouldn’t use anything but letters, numbers, periods, hyphens and underscores in a file name under any circumstances, not just when uploading them. I’ve never really understood why the OS programmers even make such file names possible—after all, they’ve been involved in crafting some of the standards that make spaces a problem!

aluminum's picture

"You shouldn’t use anything but letters, numbers, periods, hyphens and underscores in a file name under any circumstances"

There's very good reasons to use dashes in HTML files for SEO purposes (not to mention making them human-readable). The rest have been adopted by nearly every OS out there, so it's somewhat par-for-the-course. Hence the suggestion to have a disclaimer when that's NOT the norm. ;)

bowerbird's picture

if software imposes restrictions on filenames,
the software should filter the filenames itself.

in my opinion.

-bowerbird

Don McCahill's picture

> if software imposes restrictions on filenames

HTTP imposes the rules. Most of the web lives on UNIX servers, and a space in Unix means the end of the file name. A period and other punctuation have other meanings.

Don't blame the software for not adopting every Windows/Mac convention.

aluminum's picture

Bowerbird is correct. It's a basic rule of good software design. Note/fix the exceptions for the user.

But...I'm not saying code should be overhauled. Just suggesting a sentence be added to the post page. ;)

skoob's picture

HTTP imposes the rules. Most of the web lives on UNIX servers, and a space in Unix means the end of the file name. A period and other punctuation have other meanings.AFAIK, there's no restriction in HTTP on the format of filenames when uploading from a form (see RFC1867). In UNIX, the only characters that aren't allowed in filenames are "/" and the null character. All other characters are allowed -- although some characters might cause problems for certain software or require escaping.

Anyway, it's usually best not to use the filename supplied by the browser but instead generate a unique filename on the server when storing the file.

Bert Vanderveen's picture

On other Forums I visit(ed) uploaded images are auto-renamed to work in the web-environment. So it appears that it IS possible to circumvent the hassle & annoyance (I have been there too…).

. . .
Bert Vanderveen BNO

Syndicate content Syndicate content