开发者

Web-serving a file : Firefox truncates name

开发者 https://www.devze.com 2022-12-31 00:11 出处:网络
I\'m serving a file from Lighttpd whose name contains space-characters. I\'m using mimetype \"application/octet-stream\"

I'm serving a file from Lighttpd whose name contains space-characters. I'm using mimetype "application/octet-stream"

When I download this in Chrome, it works perfectly. But when I download in Firefox, the filename is truncated at the first space.

Is this to do with the mimetype? With some other light开发者_StackOverflowty config? Or maybe something to do with the kind of space-character I'm using?


You need to urlencode your links. Spaces are easily misunderstood in URLS.

The url code for space is %20 or you can also use +

So for

http://example.com/test file.jpg

You would use:
http://example.com/test%20file.jpg
or
http://example.com/test+file.jpg

I prefer to not use filenames with spaces in them.

0

精彩评论

暂无评论...
验证码 换一张
取 消