ASP.NET Request.Files is empty on flash control postback

1.1k views Asked by At

I'm using the new Aurigma Image Uploader Flash control, and creating sample pages works great. However, when I drop this control onto an existing page on my existing site, it doesn't work. I can only suspect something in the masterpage or something else on the page is messing with it.

I've tracked down the problem - Request.Files is empty when the request comes in. However, all of the data is sent in the request.

Why would Request.Files not work correctly?

Here's a excerpt of the fiddler trace of the request:

POST http://localhost:15361/myaccount/placead/new.aspx?postFiles=1 HTTP/1.1
Host: localhost:15361
Connection: keep-alive
Referer: http://localhost:15361/WebResource.axd?d=lAdTukuIRYXXlkVPS6yEQZdE0ZRhHxifFcDrPbzU_MDuk0OznXELaqd3rcUkbR18raDHqf4pWx6gUcGn391SmV3WbAt2TQUplpFdDsAU-K_ZPuSQ_dytDj992Foht1WO0&t=634202353399418554
Content-Length: 891463
x-preprocess-required: true
cache-control: private
pragma: private
content-type: multipart/form-data; boundary=A2sVEJZF32a3OWPo7FdIFd7UvoVW5qc-jeV
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.53 Safari/534.3
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: visitorId=b48169a8-778b-4da3-b12b-086f308e0a52; ASP.NET_SessionId=axobxd21maqppku1xx4cde2i; .ASPXAUTH=329A2C36F151720E0274006500730074006200720065006500640065007200000027621FE6C855CB010127960117CD55CB01370064003900630032003500390039002D0032003300340066002D0034003000370064002D0038003600350030002D0034006500610066006400350061003400380036003200330000002F00000011365FF6DADD9A79132102FAF7EEE23AEE43EBC6; .NDPROLES=AAEAAAD_____AQAAAAAAAAAMAgAAAE1TeXN0ZW0uV2ViLCBWZXJzaW9uPTIuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49YjAzZjVmN2YxMWQ1MGEzYQUBAAAAIVN5c3RlbS5XZWIuU2VjdXJpdHkuUm9sZVByaW5jaXBhbAcAAAAIX1ZlcnNpb24LX0V4cGlyZURhdGUKX0lzc3VlRGF0ZQ1fUHJvdmlkZXJOYW1lCV9Vc2VybmFtZRFfSXNSb2xlTGlzdENhY2hlZAlfQWxsUm9sZXMAAAABAQABCA0NAQIAAAABAAAAR92OOeQjzUhHqawI4CPNSAYDAAAAC1NxbFByb3ZpZGVyBgQAAAALdGVzdGJyZWVkZXIBBgUAAAApQWR2ZXJ0aXNlclVwZ3JhZGVkLEFydGljbGVzVXNlcixGb3J1bVVzZXIL0
...
...
...

--A2sVEJZF32a3OWPo7FdIFd7UvoVW5qc-jeV
Content-Disposition: form-data; name="File0Width_0"
Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8bit

1028
--A2sVEJZF32a3OWPo7FdIFd7UvoVW5qc-jeV
Content-Disposition: form-data; name="File0Height_0"
Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8bit

744
--A2sVEJZF32a3OWPo7FdIFd7UvoVW5qc-jeV
Content-Disposition: form-data; name="File0Mode_0"
Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8bit

sourceFile
--A2sVEJZF32a3OWPo7FdIFd7UvoVW5qc-jeV
Content-Disposition: form-data; name="File0Name_0"
Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8bit

image001.png_Source0.png
--A2sVEJZF32a3OWPo7FdIFd7UvoVW5qc-jeV
Content-Disposition: form-data; name="File0_0"; filenam_="image001.png_Source0.png"
Content-Type: image/png; charset=UTF-8; Content-Transfer-Encoding: binary

�PNG

��� (this goes on for a while with all the binary data...)
3

There are 3 answers

1
Joachim VR On

Perhaps the control has an FileUpload event or something similar? Something that has the files in its argument. Or perhaps a property containing the files.

Edit:

<aur:ImageUploaderFlash ID="Uploader1" runat="server"
OnFileUploaded="FileUploaded"
OnAllFilesUploaded="AllFilesUploaded">

0
userx On

Without posting YOUR code (and how it differs from the samples), this is a hard thing to help you with.

Just general some things that I'd look at (that may or may not help):

  1. <aur:ImageUploaderFlash ID="Uploader1" runat="server"/> is not inside of a <form runat="server"></form> tag set in your code, but the control requires being part of a WebForm.
  2. The WebControl requires a Script Manager control on the page.
  3. You have an HttpModule which is interfering somehow.
0
Eugene On

Saving Uploaded Files in ASP.NET:

Flash applications are not allowed to send files created by themselves as standard POST request fields accessible through the Request.Files collection. Image Uploader Flash bypasses this limitation to upload files. However, it causes some problems with retrieving these files on the server side. Image Uploader Flash ASP.NET control which comes with Image Uploader Flash provides several facilities to solve this problem...