日期:2014-05-17  浏览次数:20465 次

ASP.NET接收POST过来的文件
如何接收一下文件并保存在服务器
Content-type application/x-www-form-urlencoded
参数 
png1

/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIABgAGAMBEQACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+gEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoLEQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/AP7WtZ8C6dHuO6Lv12jjPcf59q9+HEM4WvVtrbWSsvuaW39WPkanDkJbU9PJxf5tf8OeTa34U02MP80PGeMoMf4/lXoUuKeW375N+c/x2+93OGpwmp3tRXXovnr+F+tmeP634e01C+GhPXBDJn+oH8/w6enR4vS0dVaa73/4P9dWedV4LlK9qD002stdd/8AJH89c/7dX/BUvVFtnbTdO04RzRQ3E3iDwxe2kV7KxWLO+XxDpa28dy+Wit4Y/tUbSbN8mAo/pCp4L+D0Z815qDV/ZRzWrWlzNt2vGU3ZaJe9JtpXk+v5RDxa47UZR9rzy6VYZXSpx5VbW0qNnLdyfLGNtoro3xT+39+114L0Y6n8Sr3wB4YWKItLc6h8R9CtjeOZsEWGgNv1S5kVCFW1tZr2c/NlHPIwxPhZ4K4GPNiKNamnZxjOvjXOStb3FySc7t/YTbdlotB4XxH8VMfUawWMddJtNwyrBuNP7SdSftYQjZK3vqKtq09z57tf+CsfxH8Ta9baDp/xW+DVjd3UP2hI/FWta74Wg2ShfIWXWPEWnaJpEN1kOp097pL4sREYmcZPTgvC7weq0liKWW4ypTklyyjPGvW76ToRtdWfvK99uXS+uJ498VqV41MdKMoyaap4HLHta9/Z4irNpPZxaVr3cunybqHw3+GHiOe61e18P+IPFGEaMan4s1LxNqzQzpHCLeaWfXrO2e5tYoZCTIxhilWSPyriBY5Fm+vo5rVk5WqZfRim4XlTvPnjZWcJVY6LXVSl7TRqWiT+PnhpUlCLWLle1TloezpQ5JNt2nCnP3npvBclpXg3LSAeCPhaGaPVW8O2UkUEczWen2A1bUjE1wInlhgg1sTzoZQN0MKO8RDNLKUViFis0wdZONWeCxUqai3FU1VqR5pyo3VOlSq1VH2inBvVU3GfM9HasPhswoLmpLG0YTcuWVSr7GnK0I1eV1KrpwvyOEls580eX4lFwyeAPgJ58TRz3c1wwm2rJ4LdRH9niimkH2Q32rTjK3MRhMqKbphJFbLJLFKsfCs9wmGleEPZ6yb9ngcVJpQjG8eb6nBQm+dNQnzSnFtQi2nKPcsvzPERtJqXwpOePw0U3OUlGVvrErwXJJOUUoQdnOS5oqX/2Q==

------解决方案--------------------
他post过来的是那个文件字符串是吧

你先把字符串写到一个Stream流里面
再用Bitmap map=new Bitmap(stream);实例化成一个图片
再用Save的方式保存下来,你试试行不