Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to upload file from html post to php using flow-php-sever? #25

Closed
ravitejac opened this issue Jul 17, 2015 · 1 comment
Closed

How to upload file from html post to php using flow-php-sever? #25

ravitejac opened this issue Jul 17, 2015 · 1 comment

Comments

@ravitejac
Copy link

Hi,

I am using this code and filename save it as upload.php as follows:
But after submitting the form through html and where to pass uploaded_file (i.e.,) $_FILES['uploaded_file']['tmp_name'] and $_FILES['uploaded_file']['name'] in backend how to use.

require_once 'vendor/autoload.php';

$config = new \Flow\Config();
$config->setTempDir(storage_path() . '/temp');
$destination = 'uploads/';
$file = new File($config);
$request = new \Flow\Request();

    if ($_SERVER['REQUEST_METHOD'] === 'GET') {

        if ( ! $file->checkChunk() ) {
            return \Response::make('',204);
        }
    } else {
        if ($file->validateChunk()) {
            $file->saveChunk();
        } else {
            return \Response::make('', 400);
        }
    }
    if ($file->validateFile() && $file->save($destination . $request->getFileName())) {
        return \Response::make('File upload was completed', 200);
    }
@AidasK
Copy link
Member

AidasK commented Jul 17, 2015

Some links with laravel which might help:
flowjs/ng-flow#40 (comment)
#15
#3

@AidasK AidasK closed this as completed Jul 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants