We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ofxHttpForm form; form.action = "http://localhost:8888/upload.php"; form.addFormField("userID", ofToString(userID)); form.addFile("file", "log.txt"); form.method = OFX_HTTP_POST; http.addForm( form );
$user = $_POST["userID"]; echo "User: " . $user; echo "\n"; echo "POST: " . count($_POST) . "\n"; echo print_r($_POST); echo "\n\n"; echo "FILE: " . count($_FILE) . "\n"; echo print_r($_FILE);
Result:
User: 0 POST: 1 Array ( [userID] => 0 ) 1 FILE: 0 1
POST variables get sent over, but why don't I see anything added through ofxHttpForm's::addFile()?
The text was updated successfully, but these errors were encountered:
PHP required the absolute path of the destination, thanks to this link, now works!
<?php $uploaddir = '/Users/colind/Projects/C++/openFrameworks/projects/Server/bin/data/logs/'; if (is_uploaded_file($_FILES['file']['tmp_name'])) { $uploadfile = $uploaddir . basename($_FILES['file']['name']); echo "File ". $_FILES['file']['name'] ." uploaded successfully. "; if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully moved. "; } else print_r($_FILES); } else { echo "Upload Failed!!!"; print_r($_FILES); } ?>
Sorry, something went wrong.
No branches or pull requests
Result:
POST variables get sent over, but why don't I see anything added through ofxHttpForm's::addFile()?
The text was updated successfully, but these errors were encountered: