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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:30:19+00:00 2026-06-12T21:30:19+00:00

In my web application I have to move a file from the user computer

  • 0

In my web application I have to move a file from the user computer to the server.
I have to use an ascx component to do this.

Here is the code:

Private Function FileReplciate(ByRef FilePath As String)
     'FilePath  is the full file path e.g C:/Program Files/file.txt

      ' Create an id to hide the original file name (for security)

       Dim id = New Guid;

      Try

      'Here I move the file using File.Move()  here is the error
       File.Move(FilePath, Server.MapPath("temp\" & id.ToString))

      Catch ex As exception

      End Try

End Function

So when the source file is in a folder like “MyDocuments” or “MyPictures” or any sub folder
inside the “User” folder i got the access denied error.

When the source file is in folders like “C:\” or “C:\ProgramFiles” I don’t get this error.

  • 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-12T21:30:22+00:00Added an answer on June 12, 2026 at 9:30 pm

    Usually you’re getting an error in ASP.NET because an account your application is running under don’t have appropriate permissions.

    But what you’ve described is file uploading. Server-side code has no access to client machine file system, this is impossible. Client have to upload it from a location it wish. Use <asp:FileUpload> control for this purpose.

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

Sidebar

Related Questions

I have a Web application (with a Web.config file), which will move through the
I have an HttpApplication (Global.asax) in my web application, I use this to catch
I have a few lines of jQuery in my web application. This code is
In my web application i have registration form, when user register i want to
I have started a new web application and have decided to use jquery as
For our Kunagi Java web application we have a signed kunagi.jar file which contains
I have a web application that stores a lot of user generated files. Currently
In a JS file I have this: $.ajaxSetup({ type: 'POST', contentType: application/json; charset=utf-8, dataType:
I have a web application, that contains a configuration xml file for one of
I have a Web Application hosted in IIS 6 on a Windows Server 2003

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.