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 7093273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:25:07+00:00 2026-05-28T08:25:07+00:00

The use of FileReference has a constraint on valid characters. Error: Error #2087: The

  • 0

The use of FileReference has a constraint on valid characters.
Error: Error #2087: The FileReference.download() file name contains prohibited characters.
This is fine since I guess the restriction comes from the underlying file system anyway

Is there such a things as a generic way to trim / replace all prohibited characters?

For clarity I am after something like:
var dirty:String = "Eat this !@##$%%^&&*()\/";.txt
var clean:String = dirty.replaceAllProhibitedCharacters();

I am not looking for OS specific regular expressions, but a cross platform solution.

  • 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-05-28T08:25:07+00:00Added an answer on May 28, 2026 at 8:25 am

    The list of disallowed characters does not change depending on the underlying OS, it is a fixed list. From the documentation for FileReference.download() the list of disallowed characters is:

    /\:*?"<>|%
    

    Edit: It looks like @ isn’t allowed either.

    If you want to remove those characters from an arbitrary string you can do something like this:

    var validFileName:String = invalidFileName.replace(/[\/\\:*?"<>|%@]/g, "");
    

    If you want to replace them with something else, then change the second parameter to replace().

    Edit: added the @ character; escaped the / character.

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

Sidebar

Related Questions

I want to open a file dialog via FileReference.browse() but I get #2176 error
I use a fileReference.browse() to select an image file from the harddrive. How can
I use the following to upload a file to Flex: private var filer:FileReference; protected
Use case: 3rd party application wants to programatically monitor a text file being generated
use this website a lot but first time posting. My program creates a number
I am trying to use the load method of FileReference object to load the
Use default: <input type=radio name=restype value=resdef onfocus=document.getElementById('resupload').disabled = true; document.getElementById('resadres').disabled = true; checked=checked /><br
I'm using FileReference to open a file, but I can only get the file
I have a little problem with a FileReference which I use to let users
Use trap to capture signals like this: i=-1;while((++i<33)); do trap echo $i >> log.txt

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.