如何捕获从Flash的HTTP POST文件ASP.Net页面? [英] how to catch an http post file from Flash to ASP.Net page?

查看:111
本文介绍了如何捕获从Flash的HTTP POST文件ASP.Net页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个样本我在此网站上发现:

http://kevinmusselman.com/blog/2009/02 /访问网络摄像头,带闪光/

它抓住了网络摄像头和放大器;保存图像然后将其发布到一个页面。

但似乎我无法赶上保存的图像,即时通讯在AS所以我希望这里有人可以帮助我有点生疏了。

我正在拍摄一个aspx页面的响应,并保存图像文件。这里是我的asp.net code:

 如果(Request.Files.Count == 0)
            {
                的Response.Write(错误:没有文件被上传);
                返回;
            }            字符串PT = Path.Combine(PathFolder,test.jpg放在);            如果(Directory.Exists(PathFolder))
            {
                //经历的所有文件,并保存它们关闭
                的for(int i = 0; I< Request.Files.Count;我++)
                {
                    Request.Files [I] .SaveAs(PT);
                }
                的Response.Write(成功);
            }


解决方案

这条图像不张贴作为一个图像,而是将其作为了一系列名为px0..px领域的* ROWS *。这些包含逗号分隔的像素值上该行的每个像素。

在PHP然后通过每一行单独去,那么每列,并在内存中的图像设置像素在重建成图像这一点。然后写道,到磁盘。

所以,要么你重新创建PHP,或者你试图找到一个<一个href=\"http://marstonstudio.com/2007/10/19/how-to-take-a-snapshot-of-a-flash-movie-and-automatically-upload-the-jpg-to-a-server-in-three-easy-steps/\"相对=nofollow称号=或只是做一个谷歌>不同的例子。

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 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..px*ROWS*. 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.

这篇关于如何捕获从Flash的HTTP POST文件ASP.Net页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆