php-包含文件上传功能的多步骤表单 [英] php - multi-step form with file upload
问题描述
我似乎找不到澄清的地方.我有7个步骤,第二个步骤是上传文件.我遇到的问题是,在最后一步完成表单并尝试访问临时文件时,它说无法访问文件:..."(保存在默认的tmp文件夹中).
I can't seem to find clarification. I have 7 steps and the second one is to upload a file. The problem I am having is that on the final step when I finalize the form and try and access the temp file it says "Could not access file: ..." (saved in the default tmp folder).
其他多步骤教程说,将其保留在temp文件夹中,然后在完成后移至适当的文件夹.那么,这是否意味着我将其从默认的temp文件夹移至我管理的temp文件夹,然后在他们完成表格后再次将其移至最终文件夹?
Other multi-step tutorials say to keep it in a temp folder and then move to the appropriate folder when complete. So do they mean I move it from the default temp folder into a temp folder I manage and then when they complete the form move it again to a final folder?
推荐答案
那么,这是否意味着我将其从默认的temp文件夹移至我管理的temp文件夹,然后在他们填写表格后再次将其移至最终文件夹?
So do they mean I move it from the default temp folder into a temp folder I manage and then when they complete the form move it again to a final folder?
是的,完全是.您对接收文件的请求进行了第一步,因为当请求完成后,PHP会删除它们(如果它们仍然存在).
Yes, exactly. You do the first move on the request that receives the files, because when that request is finished PHP would delete them if they still exist.
请参见 move_uploaded_file
文档 和处理文件上传.
这篇关于php-包含文件上传功能的多步骤表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!