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

183 questions
0
votes
1 answer

Using Moq with HttpPostedFileBase and one other parameter

I have a method that takes 2 parameters like: assetService(assetDto dto, HttpPostedFileBase photo) and i can't use moq with this. How can i do that? (using 'moq') public ResultObjectDto CreateAsset(AssetDto model, HttpPostedFileBase file) and i…
Osman
  • 29
  • 4
0
votes
0 answers

C# HttpPostedFileBase.ContentType fails one string comparison, passes another

I'm trying to compare the content type of an HttpPostedFileBase against an array of acceptable types, and I'm encountering some genuinely odd behaviour. array.Contains() can't find the string, but if I iterate over the collection and compare each…
roryok
  • 8,545
  • 16
  • 65
  • 130
0
votes
0 answers

On [HttpPost] Create in MVC4, need to upload a large file that will get saved to a file share in conjunction with inserting a record into SQL

I have a basic form on my Create page in my ASP.NET MVC application. The fields are strongly typed to my model. So, whenever I submit the form, a single record gets inserted into my SQL database. This is fine. The obstacle I'm encountering is I…
Mike Marks
  • 9,463
  • 15
  • 61
  • 120
0
votes
1 answer

HttpFilePostedBase parameter is null

I have the following pieces of code in my MVC 3 app: View: @(Html.Telerik().Upload() .Name("insertAttachement") .Multiple(false) .Async(async => async.Save("InsertUpload", "DocumentMaquette")) .Localizable("fr-CH") …
Silviu Preda
  • 558
  • 1
  • 6
  • 27
0
votes
1 answer

HttpPostedFileBase in ASP.NET MVC is null while using jQuery Dialog

File upload paths in MVC is null with jquery dialog I have created a MVC application having two file uploads in view and created a POST action for this, with IEnumerable parameter to catch the files. When i am submitting the form the files are…
0
votes
2 answers

HttpPostedFileBase always returns null

I am using MVC 4 and I tried for upload file concept. Here is my code:
@Html.Label("Upload the file")
user2291535
0
votes
1 answer

Linq over InputStream from HttpPostedFileWrapper

Is it possible to apply a Linq query from a HttpPostedFileWrapper? My web app allows users to select a bunch of .csv files. I now need to open those files and import them. My previous code, which uses paths and file names looks like; …
griegs
  • 22,002
  • 28
  • 113
  • 201
0
votes
1 answer

C#: Initialize HttpPostedFileBase from a file path (string)

I have a path (stored as a string) - eg \\documents\doc1.txt. I am trying to initialize a variable of type HttpPostedFileBase with the file represented by the string path. How can I do that please? I have looked at method like Model.File[count] =…
jpo
  • 3,679
  • 17
  • 52
  • 100
0
votes
2 answers

HttpPostedFileBase with PartialView

I have a main view which contains a partial view. The model of partial view has 1 property called "HttpPostedFileBase file", together with other properties However when the main-view get posted, all the other properties in that model get correct…
Samuel
  • 611
  • 1
  • 8
  • 26
0
votes
1 answer

mvc3 get full path using HttpPostedFileBase

I have a browse button and I am saving it to the database. using mvc3 view @using (Html.BeginForm("Upload", "Upload", FormMethod.Post, new { enctype = multipart/form-data" })) { } control public ActionResult…
Benk
  • 1,234
  • 5
  • 31
  • 62
-1
votes
1 answer

How to access single element of httppostedfilebase array?

I am working on ASP.NET MVC web app.I want to upload multiple files on single input control. In my view: My model: public HttpPostedFileBase[] files { get; set; } Now, in my controller, I am…
Jass
  • 99
  • 7
-1
votes
1 answer

how to upload multiple files using a single upload control in a MVC application

Am having a MVC application wherein user uses the fileupload control and upload the file which is having 30 MB or more into the sql db. am pretty new to MVC arch., so, am sorry,i may ask stupid questions! Now, customer says that,end users are…
dasarp
  • 123
  • 1
  • 8
-1
votes
1 answer

asp.net 415 Unsupported Media Type with formData POST

Problem : API controller cannot access HTTP request data which are included FormData object in HTTP request I need to pass file object data appended in FormData Object in http Post request to asp.net api controller and front-end is angularjs.i can…
-1
votes
1 answer

asp.net mvc with angular with multiple parameter ajax call HttpPostedFileBase file getting null value

Here i send an object and a file from my angular service: $scope.addProject = function () { { var project = {}; project["Id"] = $scope.Id; project["ProjectCode"] = $scope.ProjectCode; var…
Mohaimin Moin
  • 783
  • 8
  • 20
-1
votes
1 answer

Pass Data from view to controller with file name form file input tag in mvc

I have one mvc application , in that i created one form that user will be able to fill it online. in that form i used multiple text boxes and input file tag for user's photo . i also created model , first see this Sampleform.cshtml view @model…
Rahul Chaudhari
  • 118
  • 1
  • 16
1 2 3
12
13