Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7809059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:18:40+00:00 2026-06-02T03:18:40+00:00

Currently user can upload files as they like. So in the uploaded files there

  • 0

Currently user can upload files as they like. So in the uploaded files there are spaces, characters like ß, ü and so on. Than other users can download these files (including white spaces in the URL and so on). It works in this way but according to RFC1738 – Uniform Resource Locators (URL) only alphanumeric characters [a-zA-Z0-9] and some special/reserved characters are allowed. Also empty spaces should be avoided I think.

Currently I get for a ß a ß in the file name on the server. The user who wants to download the file gets the correct character (ß) represented from the MySQL database (utf8_unicode_ci) and so the file can be found on the server.

  • What is the correct way to handle file names?
  • Should I make a filename check and disallow the upload?
  • Should I rename the files on the server after the user upload (e.g. str_replace(), urlencode(), …)?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:18:42+00:00Added an answer on June 2, 2026 at 3:18 am

    As long as your webserver takes care of handling the file downloads, ensure that it knows about the encoding on the file-system and the file-system is compatible to the charset you use for the file-names of the uploads you handle.

    As long as everything is compatible here (it looks like you use UTF-8), you won’t run into any problems. Just ensure the encoding is set right @ every place you make use of (file-system, webserver, data-base server, database-client-connection, browser, upload POST request, file-link-offering HTTP HTML response etc.).

    If you intend to serve the files by PHP with the Content-Disposition header you should only allow the followinig character within file-names:

    a-z, A-Z, 0-9, _, - , .
    

    That’s because that header has no working specification for characters outside of the US-ASCII printable range.

    Normally when a file is uploaded, it’s filename get’s normalized. It’s also wise to do some validation / sanitizing at the point of upload.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form which includes 3 textfields so users can upload files. They
How can I allow users to upload files to their own, user designated folder,
Currently, the user can enter a quantity less than $1 on Paypal's website and
I have an upload form where users can upload images that are currently being
I let users to upload photos. User can upload multiple photos at once using
I have a web-app that allows users to upload and download image files by
I'm currently working on a web application that allows the user to upload files
Currently I have a web application where a user can use dropdown lists to
I currently have a wysiwyg iframe where the user can submit input to another
I am currently developing some user controls so that I can use them at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.