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
Seems that the lib keep the original file name and there is no way that the server can tell ng-flow the new file name, my server output this on complete:
<?php$path = __DIR__ . '/../public/images/users/';
$tmp = __DIR__ . '/../tmp/';
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$chunkDir = $tmp . DIRECTORY_SEPARATOR . $_GET['flowIdentifier'];
$chunkFile = $chunkDir.'/chunk.part'.$_GET['flowChunkNumber'];
if (file_exists($chunkFile)) {
header("HTTP/1.0 200 Ok");
} else {
header("HTTP/1.0 404 Not Found");
}
}
// $file = $path . (isset($_FILES['file']) ? $_FILES['file']['name'] : $_GET['flowFilename']); // this is using original name, but in this case the file sooner or later will be overrite by other user that upload a file with the same name$file = $path . md5(time()); // The way I want, it need to add the extension but it was a test onlyif (isset($_FILES)) {
copy($_FILES['file']['tmp_name'], $file);
echojson_encode([
'success' => true,
//optional'flowTotalSize' => $_FILES['file']['size'],
'flowIdentifier' => $_FILES['file']['name'] . '-' . $_FILES['file']['size'],
'flowFilename' => basename($file),
'flowRelativePath' => 'http://localhost/images/users/' . basename($file)
]);
} else {
if (\Flow\Basic::save($file, $tmp)) {
echojson_encode([
'success' => true,
//optional'flowTotalSize' => $_GET['flowTotalSize'],
'flowIdentifier' => basename($file),
'flowFilename' => basename($file),
'flowRelativePath' => 'http://localhost/images/users/' . basename($file)
]);
}
}
The text was updated successfully, but these errors were encountered:
Seems that the lib keep the original file name and there is no way that the server can tell ng-flow the new file name, my server output this on complete:
my upload script:
The text was updated successfully, but these errors were encountered: