You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewDisplayException('No template file was found submitted with this request.');
116
+
}
117
+
118
+
if (!$data['file_upload']->isValid()) {
119
+
thrownewDisplayException('The file provided does not appear to be valid.');
120
+
}
121
+
122
+
if (!in_array($data['file_upload']->getMimeType(), [
123
+
'application/zip',
124
+
'text/plain',
125
+
'application/json'
126
+
])) {
127
+
thrownewDisplayException('The file provided (' . $data['file_upload']->getMimeType() . ') does not meet the required filetypes of application/zip or application/json.');
128
+
}
129
+
130
+
if ($data['file_upload']->getMimeType() === 'application/zip') {
131
+
$zip = new \ZipArchive;
132
+
if (!$zip->open($data['file_upload']->path())) {
133
+
thrownewDisplayException('The uploaded archive was unable to be opened.');
<pclass="text-muted"><small>This package file must either be a <code>.zip</code> or <code>.tar.gz</code> archive of files to use for either building or running this pack.<br /><br />If your file is larger than <code>20MB</code> we recommend uploading it using SFTP. Once you have added this pack to the system, a path will be provided where you should upload the file.
155
-
This is currently configured with the following limits: <code>upload_max_filesize={{ini_get('upload_max_filesize') }}</code> and <code>post_max_size={{ini_get('post_max_size') }}</code>. If your file is larger than either of those values this request will fail.</small></p>
155
+
This server is currently configured with the following limits: <code>upload_max_filesize={{ini_get('upload_max_filesize') }}</code> and <code>post_max_size={{ini_get('post_max_size') }}</code>. If your file is larger than either of those values this request will fail.</small></p>
<pclass="text-muted"><small>This file should be either the <code>.json</code> template file, or a <code>.zip</code> pack archive containing <code>archive.(zip|tar.gz)</code> and <code>import.json</code> within.<br /><br />This server is currently configured with the following limits: <code>upload_max_filesize={{ini_get('upload_max_filesize') }}</code> and <code>post_max_size={{ini_get('post_max_size') }}</code>. If your file is larger than either of those values this request will fail.</small></p>
0 commit comments