简体   繁体   English

如何通过 $_FILES 重新传递图像文件?

[英]how to pass repass an image file from $_FILES?

I'm trying to make a two-step form on PHP.我正在尝试在 PHP 上制作一个两步式表单。 On the first step the form asks form some data and and an image.第一步,表单要求表单一些数据和图像。 On the second step it asks for some more data and I repass the data from the first step through a input type hidden.在第二步中,它要求提供更多数据,然后我通过隐藏的输入类型重新传递第一步中的数据。

Is there a way to pass the image from the first step, like i do with the data in the hidden type input?有没有办法从第一步传递图像,就像我处理隐藏类型输入中的数据一样?

Yes, there is at least one way to pass image from first step.是的,至少有一种方法可以从第一步传递图像。 Start the session开始会话

session_start();

and store image name at并将图像名称存储在

$_SESSION['my_image']=$_FILES['file_input_name']['tmp_name'];

instead repassing the file name at hidden input.而是在隐藏输入处重新传递文件名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM