php上传文件回显,php 使用dropzonejs拖拽文件上传,如何将处理结果回显到当前页的textarea中?...

修改了下dropzonejs的demo上传页面:(原地址:http://www.dropzonejs.com/exa...)加了个textarea,想实现文件上传处理完成后将处理结果回显到textarea内,请问该如何处理?

以下是index.php文件内容:

Dropzone simple example

This is the most minimal example of Dropzone. The upload in this example

doesn't work, because there is no actual server to handle the file upload.

以下是upload_file.php文件内容:

0) {

echo "Error: " . $_FILES["file"]["error"] . "

";

} else {

echo "Upload: " . $_FILES["file"]["name"] . "

";

echo "Type: " . $_FILES["file"]["type"] . "

";

echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb

";

echo "Stored in: " . $_FILES["file"]["tmp_name"];

$content = file_get_contents($_FILES["file"]["tmp_name"]);

echo $content;

}

?>

回复内容:

修改了下dropzonejs的demo上传页面:(原地址:http://www.dropzonejs.com/exa...)加了个textarea,想实现文件上传处理完成后将处理结果回显到textarea内,请问该如何处理?

以下是index.php文件内容:

Dropzone simple example

This is the most minimal example of Dropzone. The upload in this example

doesn't work, because there is no actual server to handle the file upload.

以下是upload_file.php文件内容:

0) {

echo "Error: " . $_FILES["file"]["error"] . "

";

} else {

echo "Upload: " . $_FILES["file"]["name"] . "

";

echo "Type: " . $_FILES["file"]["type"] . "

";

echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb

";

echo "Stored in: " . $_FILES["file"]["tmp_name"];

$content = file_get_contents($_FILES["file"]["tmp_name"]);

echo $content;

}

?>

可以通过ajax获取上传后的图片地址,然后显示

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值