[英]Attach file to form on redirect
Im providing a file preview option, where the user attaches a file, and then clicks preview. 我提供了文件预览选项,用户可以在其中附加文件,然后单击预览。 Which uploads the file, and outputs a PHPExcel preview. 上载文件,并输出PHPExcel预览。
From that page, I want to include a button that says continue. 在该页面上,我想包含一个继续按钮。 Which will then proceed with the actual upload and database row creation. 然后将继续进行实际的上载和数据库行的创建。
However once I redirect to the preview page, I have no idea how to attach this file to my hidden form for resubmission. 但是,一旦我重定向到预览页面,我就不知道如何将此文件附加到我的隐藏表单中以重新提交。
I can attach all the old input values....like so... But how do I attach the file??? 我可以附加所有旧的输入值...。像这样...但是如何附加文件??? (using blade in laravel for templating) (使用laravel中的刀片进行模板制作)
/* These work and are correct*/
<input type="text" id="xlsColumnOrder" name="xlsColumnOrder" value="{{$input['xlsColumnOrder']}}"/>
<input type="text" name="researcher" value="{{$input['researcher']}}" />
<input type="text" name="leadcity" value="{{$input['leadcity']}}" />
<input size="16" id="survey_date" name="survey_date" type="text" value="{{$input['survey_date']}}" />
/* This doesnt attach anything to the file input
/* Need to attach the previously uploaded file here for resubmission */
<input class="file" id="csvfile" name="csvfile" type="file" value="{{$file['csvfile']['tmp_name']}}" />
You cannot automatically resend user files so I would do it this way: 您无法自动重新发送用户文件,因此我可以这样进行:
As addition you should have some kind of cron that removes data from your temporary directory that very created for example more than 3 hours 另外,您应该具有某种cron来从您的临时目录中删除数据,而该临时目录的创建时间非常长,例如3个小时
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.