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

  • SEARCH
  • Home
  • 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 8359417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:08:20+00:00 2026-06-09T11:08:20+00:00

I have an application that let users export files from a custom template filled

  • 0

I have an application that let users export files from a custom template filled with some data, and right now they can choose the location it will save to. If the file already exists, it will either overwrite it or generate a new name according to their preference.

Whatever folder / file name it will export to and whether it will overwrite the file if it exists or not is stored in a config file the user creates and saves. Then all he does is run this file, and the application will start gathering data and exporting these files.

So the danger is that I could send you a config file that saves to the C drive and all you’d need to do is open it and run it and it could overwrite files you have on your C drive if they happen to have the same name. What I’m considering doing is having the user select a folder where to save files, and store this preference not in the config file but save it as a user preference, so if I give you a config file, this file will export to whatever folder you’ve chose to export to. The config file would determine the file name, though.

Is easy to force them to enter only valid file characters as a file name (which would exclude the \ character), but I would like to allow them to enter a sub folder and file name instead of only a file name in the config file so they can better organize their exported files. But if I do, they could enter something like ..\..\something_important.exe, which would save outside the folder the user has defined for his exports. How would you ensure they can enter a path like \sub\subsub\myfile.txt but not like ..\..\myfile.txt. Would it be enough to ensure there are no ..\ strings in the path? Is there any other code like ..\ that could let them navigate up the folder tree?

  • 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-09T11:08:21+00:00Added an answer on June 9, 2026 at 11:08 am

    I suggest that you use the FolderBrowserDialog to allow the user to select a folder. This is a common dialog that user probably has experience in using. If you have additional rules around which folder the user can select you can perform this validation after the user selected the folder and reject it if say the user selected a root folder.

    FolderBrowserDialog

    (Image taken from FolderBrowserDialog in C#.)

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

Sidebar

Related Questions

I have an application that let users to upload files to server. All files
Let say, I have a web application that allows users to upload images and
I have this iPhone application that let users take a picture and save it
I have this route that let me build custom url for users like /thisismyname,
[edit] We're collecting credit application data from users on a web form. I have
So I have a web application that serves some data...lets say if I query
I have an application that consists of two processes (let's call them A and
Let me share the following scenario: I have a ASP.NET intranet Web-based application that
Let's say that I have an application frame, and I want to show a
I am having a problem with structuring rails application. Let's say that I have

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.