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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:33:12+00:00 2026-06-10T02:33:12+00:00

I am trying to download a file from dropbox using the RESTful API. When

  • 0

I am trying to download a file from dropbox using the RESTful API. When I encounter a file that has a space in it “My Photo.png” the program stops on var request = (HttpWebRequest) WebRequest.Create(requestUri); It returns a 403 error. If I remove the spaces and try the file download again it works perfectly. Ive checked the formatted uri and it is being returned as “My+Photo.png” is this how it should be? What am I doing wrong?

    var uri = new Uri(new Uri(DropboxRestApi.ApiContentServer),
        String.Format("files?root={0}&path={1}",
        root, UpperCaseUrlEncode(path)));

My Method:

    private static string UpperCaseUrlEncode(string s)
    {
        char[] temp = HttpUtility.UrlEncode(s).ToCharArray();
        for (int i = 0; i < temp.Length - 2; i++)
        {
            if (temp[i] == '%')
            {
                temp[i + 1] = char.ToUpper(temp[i + 1]);
                temp[i + 2] = char.ToUpper(temp[i + 2]);
            }
        }
        return new string(temp);
    }
  • 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-10T02:33:13+00:00Added an answer on June 10, 2026 at 2:33 am

    Could you do the normal URLEncode and do a string.Replace on the temp string it will work perfect for files with a space in the file name

    temp = temp.Replace("+", "%20"); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to download a file from a website using python and mechanize.
On Ubuntu, I am trying to download a file (from a script) using wget.
I am trying to implement an Asynchronous file download from a web server using
When I am trying to download a file whose name has characters from languages
I'm trying out http requests to download a pdf file from google docs using
I am trying to download a file from a site using perl. I chose
I am trying to download a file from an FTP server using an NSOperation.
I'm trying to download file with Python using IE: from win32com.client import DispatchWithEvents class
I am trying this code to download a file from a Windows machine using
i'm trying to download file from http server using WinINet library calls. It works

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.