how to catch an http post file from Flash to ASP.Net page?
I'm working on a sample i found on this site:
http://kevinmusselman.com/blog/2009/02/access-webcam-with-flash/
it captures the webcam & saves the开发者_如何学JAVA image then posts it to a page.
but it seems that i couldn't catch the saved image, im kinda rusty on AS so I hope someone here could help me.
i'm capturing the response in a aspx page and save the image in a file. here's my asp.net code:
if (Request.Files.Count == 0)
{
Response.Write("ERROR: No files were uploaded");
return;
}
string pt = Path.Combine(PathFolder, "test.jpg");
if (Directory.Exists(PathFolder))
{
//go through all of the files and save them off
for (int i = 0; i < Request.Files.Count; i++)
{
Request.Files[i].SaveAs(pt);
}
Response.Write("SUCCESS");
}
That article doesn't post the image as an image, rather it sends it as a series of fields called px0..pxROWS. These contain the Comma separated pixel values for each pixel on that row.
The PHP then reconstructs this into a image by individually going through each row, then each column, and setting the pixel in an in memory image. Then writes that to disk.
So, either you recreate the PHP, or you try to find a different example.
精彩评论