-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 send input texts to PHP with Upload #763
Comments
Include a Here is a working example from the project I am working on:
|
From version 5.0.0 instead of setting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Im using ng-file-upload,for a project im developing. The issue is: How can I sent more data besides the file. In my form Im sending the data of the file and two text inputs to the server. Using the Upload method the file is sended without problem but the two inputs are not detected by the server.I don't know If Im sending wrong from the client or the server. Here's a part of my code.
That's how i send the file and the dat with upload:
Upload.upload({
url: 'http://localhost/degusto/uploadRecipe.php',
file: file,
method: 'POST',
data: {
nombre: recipe.nombre,
descrip: recipe.descrip},
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
...
Here's the server part(PHP):
$data = json_decode(file_get_contents('php://input'), true);
// Check if the two inputs are not null
if(isset($data['nombre']) && isset($data['descrip'])){
...
}
The text was updated successfully, but these errors were encountered: