Questions tagged [httppostedfile]

51 questions
1
vote
1 answer

Is there a way to get an httppostedfile WITHOUT using the fileuplaod control?

I have a class that needs an System.Web.HttpPostedFile object. In most cases this is obtained when the user uploads a pic. However, in cases where they don't I need to pass a default image to the class. But how do I populate the HttpPostedFile…
KoolMoK
  • 161
  • 1
  • 1
  • 3
1
vote
1 answer

asp.net and input type=file multiple read data from code behind

I have an I don't use asp:FileUpload because I need to use a jQuery plugin for multiple image previews and for deleting images before upload them. My question is How can I…
Martina
  • 1,852
  • 8
  • 41
  • 78
1
vote
1 answer

I receive "This request requires buffering data to succeed" exception while CloudBlockBlob.UploadFromStream from a HttpPostedFile

Stream Code var httpRequest = HttpContext.Current.Request; if (httpRequest.Files.Count == 1) { HttpPostedFile file = httpRequest.Files[0]; CloudStorageAccount storageAccount =…
M3T4LM1K3
  • 31
  • 7
1
vote
1 answer

I want to upload file to HttpPostedFile which is present in "images" folder of my asp.net website

How to assign image present in "images" folder of my asp.net website to HttpPostedFile?
1
vote
1 answer

MVC: when is a file uploaded?

When uploading files to a server and calling a controller method does a HttpPostedFileBase contain the entire file or just information such as name, path, etc? What I want to know is if the file is uploaded to the server right away or not until…
Mihai Bratulescu
  • 1,915
  • 3
  • 27
  • 43
1
vote
1 answer

double encoded filename in ContentDisposition non-ascii characters

I am having an issue with the filename in my Content-Disposition being mime/quoted-printable encoded but HttpContext.Current.Request.Files is not decoding the value, instead i get 'filenames' like: =?utf-8?B?Zm9vIOKAkyBiYXIubXNn?= It should say…
Seph
  • 8,472
  • 10
  • 63
  • 94
1
vote
0 answers

Post file from Android to Asp.NET Server using HttpPostedFile

Till now, I was converting image to Base64String and then send it to Asp.NET server and convert it to image there. But recently, I came to know that HttpPostelFile is good method for it. I Google for some example but din't get anyone. Please anyone…
Jeeten Parmar
  • 5,568
  • 15
  • 62
  • 111
0
votes
0 answers

How to convert a System.IO.File type to HttpPostedFile type programatically in ASP.NET

We are trying to programmatically extract PDF file from Local System as System.IO.File type and convert to HttpPostedFile type . Please share any C# codes for this conversion.
Sylesh JL
  • 1
  • 1
0
votes
1 answer

Cannot save file when unit testing a file upload

I try to Unit test a mvc controller that receive a model that has a HttpPostedFile as parameter var constructorInfo = typeof(HttpPostedFile).GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance)[0]; var obj =…
MTplus
  • 2,077
  • 4
  • 34
  • 51
0
votes
1 answer

How to record files on a server with minimal access using MVC

How to record files on a server with minimal access using MVC. The next version of the code is not suitable as it will be clogging up the domain. Controller code: var fileFile = Request.Files["p" + prop.Id]; if (fileFile == null) continue; string…
revolutionkpi
  • 2,632
  • 10
  • 45
  • 84
0
votes
0 answers

ASP.Net HttpPostedFileBase missing reference

.NET 5.0 I'm getting an error trying to use HttpPostedFileBase: The type or namespace name 'HttpPostedFileBase'could not be found(are you missing a using directive or an assembly reference?) I have included using System.web but it isn't doing…
Cole Perry
  • 333
  • 1
  • 5
  • 27
0
votes
0 answers

Processing a bitmap in a restful api c#

i have a bitmap in which my bellow code returns the positions/coordinates of the dots in the image as follows: public static void Main() { var resource = Assembly.GetExecutingAssembly().GetManifestResourceStream("test.png"); …
marry
  • 153
  • 2
  • 3
  • 15
0
votes
2 answers

How to Send and Receive file?

I want following type of functionality There are two users A and B both are visiting same page This page has a button(Send File) . When A clicks on button an Open Dialog box should appear When A selects a file from Open Dialog box then there…
Amit
  • 21,570
  • 27
  • 74
  • 94
0
votes
0 answers

Get HttpInputStream in C#

I'm working with a C# class for sending emails that expects a List of HttpPostedFiles as one of its method's parameters (for file attachment to an email). I have a file (on the file system) that I want to attach to an email in my program and I'm…
Melanie
  • 3,021
  • 6
  • 38
  • 56
0
votes
1 answer

Asp.Net HttpPostedFile.SaveAs fails: access is denied

In my ASP.NET web application, I am trying to upload a file using JQuery Ajax which in turn calls .ashx handler. Files should be saved to pdf folder which is created under the project's tree using: Add --> New Folder When deployed and tested,…
Nina
  • 508
  • 4
  • 21