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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:40:59+00:00 2026-05-13T11:40:59+00:00

I have a very simple file upload that allows users to upload PDF files.

  • 0

I have a very simple file upload that allows users to upload PDF files. On another page I then reference those files through an anchor tag. However, it seems that when a user upload a file that contains the pound sign (#) it breaks the anchor tag. It doesn’t cause any type of Coldfusion error, it just can’t find the file. If I remove the #, it works just fine. I am sure there are a number of other characters that would have this same issue.

I’ve tried putting URLEncodedFormat() around the file name inside the anchor but that doesn’t help. The only other thing I could think of was to rename the file each time it was uploaded and remove the “#” character (and any other “bad” character).

There has got to be an easier solution. Any ideas?

  • 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-13T11:40:59+00:00Added an answer on May 13, 2026 at 11:40 am

    If you control the file upload code try validating the string with

     IsValid("url",usersFileName) or
     IsValid("regex",usersFileName,"[a-zA-Z0-9]")
    

    Otherwise if you are comfortable with regex I would suggest something like the previous posters are commenting on

      REReplace(usersfilename,"[^a-zA-Z0-9]","","ALL")
    

    These samples assume you will add the “.pdf” and only allows letters and numbers. If you need underscores or the period it would look like this…

      REReplace(usersfilename,"[^a-zA-Z0-9\._]","","ALL")
    

    I am not a regex guru, if I have one of these wrong I am sure several will jump in and correct me 🙂

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

Sidebar

Related Questions

I have a very simple ASP.Net page that acts as a front end for
i have a very simple excel file that i need to import into a
I am implementing a very simple file database. I have 2 basic operations: void
i have very simple problem. I need to create model, that represent element of
I have a very simple bit of script that changes the status of an
I have a very simple Java RMI Server that looks like the following: import
I have a very simple JSF 2.0 project. I have an index.xhtml file to
I have a very simple application that use a 2 component UIPickerView that causes
I have a very simple app on my local machine that uses the ASP.NET
Very simply put, I have the following code snippet: FILE* test = fopen(C:\\core.u, w);

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.