Questions tagged [httppostedfilebase]

A class type in .NET used to assist with file uploads.

HttpPostedFileBase is a .NET class designed to make file uploads in ASP.NET projects easier.

MSDN Documentation

188 questions
0
votes
1 answer

Passing in HttpPostedFileBase and FormCollection from Ajax

I'm currently working on a project where the previous contractor had an attachments area within our site. The piece works for the most part but has issues when redirecting back after uploading the file, plus I don't like the fact the page does a…
IyaTaisho
  • 863
  • 19
  • 42
0
votes
1 answer

C# HttpPostedFileBase object.ContentType property check for supported type validation

I am trying to validate file upload by supported file types, for now I am comparing ContentType property with list of supported file types like "text/xml" "application/x-zip-compressed" etc. I have found these strings simply by trying to upload…
eomeroff
  • 9,599
  • 30
  • 97
  • 138
0
votes
0 answers

Chrome hangs when input tag contains name attribute

I have a very basic multiple file uploader that works on Firefox and IE but on Chrome it hangs when I include the name="files" attribute in the input tag below. Has anyone else experienced this problem? and if so is there a work around?
0
votes
1 answer

How to send HttpPostedFile to an action in some controller

If you want to send an object of type HttpPostedFile to an action, you may get null object in the action. So how to send it?
0
votes
0 answers

HttpPstedFileBase value is null in asp .net MVC controller while trying to upload a file using JQuery

Following is the JQuery code that I'm using: $('#btnVideoUpload').click( function () { var xhr = new XMLHttpRequest(); var fd = new FormData(); fd.append("AssociatedVideoFile", $('#AssociatedVideoFile')[0]); …
randomstudious
  • 122
  • 2
  • 10
0
votes
1 answer

Asp.net MVC 5 Ajax Multi File Upload may need value provider, suggestions?

I am working on MVC 5 application. And i need to upload multiple files. What I know is HttpPostedFile and HttpPostedFileBase classes can get one file. But my condition is I need multiple files to be uploaded at once. My question is, 1) Since there…
user786
  • 3,902
  • 4
  • 40
  • 72
0
votes
1 answer

HttpPostedFileBase is null - Posting files from AngularJS to MVC

Similar questions have been asked so many times, but there are no clear answers, I still have trouble getting mine to work. This is the model in C# public class SubmitModel { public string Name { get; set; } public HttpPostedFileBase File {…
Aximili
  • 28,626
  • 56
  • 157
  • 216
0
votes
1 answer

Upload file takes long in the first time, ASP.NET

I recently having a problem in my web application, which is the upload process of my documents.It takes a long time for even a few kb doc/xls to upload. The way i upload the document is:
PSo
  • 958
  • 9
  • 25
0
votes
1 answer

HttpPostedFileBase.InputStream Cast to Stream Silently Fails

I'm new to working with streams and having difficulty uploading a text file from a web app to AWS. Specifically, a cast on the HttpPostedFileBase.InputStream to (Stream) doesn't throw an error, but the resulting Stream contains no data even though…
jle
  • 269
  • 8
  • 25
0
votes
1 answer

How to Get filePath from HttpPostedFileBase

I'm uploading photos to a external library and the API to this library needs the path to the file I'm uploading. Here is my Code: public ActionResult UploadImageToCloudinary(HttpPostedFileBase file, string group, string filter) { if…
user3228992
  • 1,373
  • 1
  • 16
  • 31
0
votes
1 answer

When I try to upload a file in ASP.NET MVC, it shows as null

For some reason the paramater OriginalLocation is always null in the following code. What am I doing wrong? Controller: [HttpPost] public ActionResult File(HttpPostedFileBase OriginalLocation, FileModel model) { byte[] binaryData = null; …
r.r
  • 7,023
  • 28
  • 87
  • 129
0
votes
0 answers

HttpPostedFileBase.SaveAs() does it reatin the value with new path

I have an action method on which i post the file and then , i need to upload or save this file on server in some temp location and read the data from that file. public static string UploadFile(HttpPostedFileBase…
user1595214
  • 521
  • 3
  • 10
  • 22
0
votes
0 answers

HttpPostedFileBase always remaining null mvc 5

I know this question asked many times, but no answer of them work for me. My view like...
@Html.LabelFor(model => model.VHF, new { @class = "control-label col-md-2" })
Blue
  • 1
  • 1
0
votes
0 answers

Pass HttpPostedFileBase as an Argument in Ajax call

I am working on an ASP.NET MVC 4 application and there are many views where the user can upload a file which I save on the server using Ajax. My View page is,

Md Aslam
  • 1,228
  • 8
  • 27
  • 61
0
votes
1 answer

Return file in input

I have a form where i can input multiple image files. When inserting i can recover them on the server with the content from Request.Files, then i add the files as byte[] to my model, with the filename as well. My problem relies on when i'm trying to…
mfklauberg
  • 24
  • 1
  • 7