Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP到ASP base64\u解码_Php_Asp.net_Image_Base64 - Fatal编程技术网

PHP到ASP base64\u解码

PHP到ASP base64\u解码,php,asp.net,image,base64,Php,Asp.net,Image,Base64,我有一些PHP代码,可以从一个字符串数据创建一个图像,我想知道如何将其转换为ASP: $jpg = base64_decode($_POST['imagedata']); header('Content-Type: image/jpeg'); header("Content-Disposition: attachment; filename=".$_GET['name']); echo $jpg; 它是否符合下面的代码 var image = Request.Params["imagedata

我有一些PHP代码,可以从一个字符串数据创建一个图像,我想知道如何将其转换为ASP:

$jpg = base64_decode($_POST['imagedata']);
header('Content-Type: image/jpeg');
header("Content-Disposition: attachment; filename=".$_GET['name']);
echo $jpg;
它是否符合下面的代码

var image = Request.Params["imagedata"];
if (string.IsNullOrEmpty(imagedata)) return;
var imageContent = Convert.FromBase64String(image);
Response.ContentType = "image/jpeg";
using (var os = Response.OutputStream)
{
  for (int i = 0; i < imageContent.Length; i++)
    os.WriteByte(imageContent[i]);
  os.Flush();
  os.Close();
}
var image=Request.Params[“imagedata”];
if(string.IsNullOrEmpty(imagedata))返回;
var imageContent=Convert.FromBase64String(图像);
Response.ContentType=“image/jpeg”;
使用(var os=Response.OutputStream)
{
for(int i=0;i

谢谢

你说的是经典的ASP(前.net时代)还是ASP.net???对不起,我应该指定-使用ASP.net