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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:10:57+00:00 2026-06-05T03:10:57+00:00

I am attempting to upload an image to my IIS 7 server, but it

  • 0

I am attempting to upload an image to my IIS 7 server, but it is coming out corrupted. The same code works on a local instance through Visual Studio.

Local headers:

Request URL:http://localhost:55272/MyProfile/UploadPhoto?qqfile=01.jpg
Request Method:POST
Status Code:302 Found
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:464542
Content-Type:application/octet-stream
Host:localhost:55272
Origin:http://localhost:55272
Referer:http://localhost:55272/MyProfile
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1130.1 Safari/536.11
X-File-Name:01.jpg
X-Mime-Type:image/jpeg
X-Requested-With:XMLHttpRequest
Query String Parametersview URL encoded
qqfile:01.jpg
Response Headersview source
Cache-Control:private
Connection:Close
Content-Length:137
Content-Type:text/html; charset=utf-8
Date:Thu, 10 May 2012 06:35:28 GMT
Location:/MyProfile/MyProfile
Server:ASP.NET Development Server/10.0.0.0
X-AspNet-Version:4.0.30319
X-AspNetMvc-Version:3.0

Remote headers:

Request URL:[remotehost]/XMVC/MyProfile/UploadPhoto?qqfile=01.jpg
Request Method:POST
Status Code:302 Found
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Authorization:Negotiate -snip-
Connection:keep-alive
Content-Length:464542
Content-Type:application/octet-stream
Cookie:ASPSESSIONIDAABCCDSD=-snip-
Host:[remotehost]
Origin:[remotehost]
Referer:[remotehost]/XMVC
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1130.1 Safari/536.11
X-File-Name:01.jpg
X-Mime-Type:image/jpeg
X-Requested-With:XMLHttpRequest
Query String Parametersview URL encoded
qqfile:01.jpg
Response Headersview source
Cache-Control:private
Content-Length:142
Content-Type:text/html; charset=utf-8
Date:Thu, 10 May 2012 06:35:05 GMT
Location:/XMVC/MyProfile/MyProfile
Persistent-Auth:false
Server:Microsoft-IIS/7.5
WWW-Authenticate:Negotiate -snip-
X-AspNet-Version:4.0.30319
X-AspNetMvc-Version:3.0
X-Powered-By:ASP.NET

Here is my upload method that is called by the upload form:

[HttpPost]
public ActionResult UploadPhoto(object qqfile)
{
    // Get current logged in user
    var currentUser = _staffRepository.StaffMembers.First(p => p.Login == User.Identity.Name.Replace("Domain\\", ""));

    var length = Request.ContentLength;
    var bytes = new byte[length];
    Request.InputStream.Read(bytes, 0, length);
    // bytes has byte content here. what do do next?

    var fileName = currentUser.Login + ".jpg";

    var saveToFileLoc = string.Format("{0}\\{1}",
                                   Server.MapPath("~/App_Data/uploads"),
                                   fileName);

    // save the file.
    var fileStream = new FileStream(saveToFileLoc, FileMode.Create, FileAccess.ReadWrite);
    fileStream.Write(bytes, 0, length);
    fileStream.Close();

    return new RedirectResult("MyProfile");
}

If it is relevant I am using this File Uploader

The image comes out on the remote server as all NUL bytes. Any assistance is appreciated.

  • 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-05T03:10:59+00:00Added an answer on June 5, 2026 at 3:10 am

    Turns out this was a Chrome bug that has since been fixed in stable 19.0.1084.52 (released 23rd May).

    Specific revision: https://src.chromium.org/viewvc/chrome?view=rev&revision=138291

    Detailed analysis: http://inedo.com/support/kb/1019/workaround-for-chrome-file-uploading-bug

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

Sidebar

Related Questions

I am attempting to upload files to my Sharepoint 2010 server running on IIS
I am getting an internal server error when I am attempting to upload images
I am attempting to upload files to my server using ASP.NET MVC. Here is
I'm attempting to upload an image as well as add details such as; title,
I am trying to upload an image to the server (with a path in
I am attempting to use the following code to upload a photo to Facebook
I am attempting to upload a large file from iOS to a server My
I'm attempting to upload an image via ajax using paperclip. I'm using the qqfileuploader
I'm having trouble to get the following code to upload large images. It works
I'm attempting to upload a file asynchronously using HTTP POST and jQuery, but I'm

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.