form_open_multipart does not upload a file
I want to upload an image, through this form:
<?php echo form_open_multipart('posts/create'); ?>
<div class="form-group">
<label>Title</label>
<input type="text" class="form-control" name="title" placeholder="Add Title" required>
</div>
<div class="form-group">
<label>Body</label>
<textarea id="editor1" class="form-control" name="body" placeholder="Add Body" required></textarea>
</div>
<div class="form-group">
<label>Category</label>
<select name="category_id" class="form-control">
<?php foreach($categories as $category): ?>
<option value="<?php echo $category['id']; ?>"><?php echo $category['name']; ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label>Upload Image</label>
<input type="file" name="userfile" size="20">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
And when I send the information, and I check if the POST petition has the correct data. It doesn't.
It shows me all the inputs expect the file input...
This is the controller, is called Posts and the function is call create.
public function create() {
$data['title'] = 'Create post';
$data['categories'] = $this->post_model->get_categories();
$this->form_validation->set_rules('title', 'Title', 'required');
$this->form_validation->set_rules('body', 'Body', 'required');
if (!$this->form_validation->run()) {
$this->load->view('templates/header');
$this->load->view('posts/create', $data);
$this->load->view('templates/footer');
} else {
// Upload image
$config['upload_path'] = 'assets/images/posts';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 2048;
$config['max_width'] = 2000;
$config['max_height'] = 2000;
$this->load->library('upload', $config);
# Here's where I print the request.
print_r($_POST);
if (!$this->upload->do_upload('userfile')) {
$errors = array('error' => $this->upload->display_errors());
$post_image = 'noimage.jpg';
} else {
$data = array('upload_data' => $this->upload->data());
$post_image = $_FILES['userfile']['name'];
}
echo $post_image;
/* $this->post_model->create_post($post_image);
redirect('posts'); */
}
}
The autoloader.php is configured correctly...
$autoload['helper'] = array('url', 'form', 'text');
If someone needs the complete project, here you go
I'm using Docker to run it, with docker-compose up --build
you can test it.
php codeigniter
|
show 2 more comments
I want to upload an image, through this form:
<?php echo form_open_multipart('posts/create'); ?>
<div class="form-group">
<label>Title</label>
<input type="text" class="form-control" name="title" placeholder="Add Title" required>
</div>
<div class="form-group">
<label>Body</label>
<textarea id="editor1" class="form-control" name="body" placeholder="Add Body" required></textarea>
</div>
<div class="form-group">
<label>Category</label>
<select name="category_id" class="form-control">
<?php foreach($categories as $category): ?>
<option value="<?php echo $category['id']; ?>"><?php echo $category['name']; ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label>Upload Image</label>
<input type="file" name="userfile" size="20">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
And when I send the information, and I check if the POST petition has the correct data. It doesn't.
It shows me all the inputs expect the file input...
This is the controller, is called Posts and the function is call create.
public function create() {
$data['title'] = 'Create post';
$data['categories'] = $this->post_model->get_categories();
$this->form_validation->set_rules('title', 'Title', 'required');
$this->form_validation->set_rules('body', 'Body', 'required');
if (!$this->form_validation->run()) {
$this->load->view('templates/header');
$this->load->view('posts/create', $data);
$this->load->view('templates/footer');
} else {
// Upload image
$config['upload_path'] = 'assets/images/posts';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 2048;
$config['max_width'] = 2000;
$config['max_height'] = 2000;
$this->load->library('upload', $config);
# Here's where I print the request.
print_r($_POST);
if (!$this->upload->do_upload('userfile')) {
$errors = array('error' => $this->upload->display_errors());
$post_image = 'noimage.jpg';
} else {
$data = array('upload_data' => $this->upload->data());
$post_image = $_FILES['userfile']['name'];
}
echo $post_image;
/* $this->post_model->create_post($post_image);
redirect('posts'); */
}
}
The autoloader.php is configured correctly...
$autoload['helper'] = array('url', 'form', 'text');
If someone needs the complete project, here you go
I'm using Docker to run it, with docker-compose up --build
you can test it.
php codeigniter
The file is in te $_file array
– Lelio Faieta
Jan 1 at 1:50
I print $_FILES and it gives me the right file, check the code and you'll see the error
– Andrés Montoya
Jan 1 at 1:53
It’s the normal behavior that you don’t see the file input in post array. What is your error?
– Lelio Faieta
Jan 1 at 1:55
When I do click in the form, it does not send the file I've uploaded
– Andrés Montoya
Jan 1 at 1:56
Your form is part in the post array and part in the file array. Still don’t see the issue. It is the normal behavior. You say you see both arrays populated so what is the issue?
– Lelio Faieta
Jan 1 at 1:58
|
show 2 more comments
I want to upload an image, through this form:
<?php echo form_open_multipart('posts/create'); ?>
<div class="form-group">
<label>Title</label>
<input type="text" class="form-control" name="title" placeholder="Add Title" required>
</div>
<div class="form-group">
<label>Body</label>
<textarea id="editor1" class="form-control" name="body" placeholder="Add Body" required></textarea>
</div>
<div class="form-group">
<label>Category</label>
<select name="category_id" class="form-control">
<?php foreach($categories as $category): ?>
<option value="<?php echo $category['id']; ?>"><?php echo $category['name']; ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label>Upload Image</label>
<input type="file" name="userfile" size="20">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
And when I send the information, and I check if the POST petition has the correct data. It doesn't.
It shows me all the inputs expect the file input...
This is the controller, is called Posts and the function is call create.
public function create() {
$data['title'] = 'Create post';
$data['categories'] = $this->post_model->get_categories();
$this->form_validation->set_rules('title', 'Title', 'required');
$this->form_validation->set_rules('body', 'Body', 'required');
if (!$this->form_validation->run()) {
$this->load->view('templates/header');
$this->load->view('posts/create', $data);
$this->load->view('templates/footer');
} else {
// Upload image
$config['upload_path'] = 'assets/images/posts';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 2048;
$config['max_width'] = 2000;
$config['max_height'] = 2000;
$this->load->library('upload', $config);
# Here's where I print the request.
print_r($_POST);
if (!$this->upload->do_upload('userfile')) {
$errors = array('error' => $this->upload->display_errors());
$post_image = 'noimage.jpg';
} else {
$data = array('upload_data' => $this->upload->data());
$post_image = $_FILES['userfile']['name'];
}
echo $post_image;
/* $this->post_model->create_post($post_image);
redirect('posts'); */
}
}
The autoloader.php is configured correctly...
$autoload['helper'] = array('url', 'form', 'text');
If someone needs the complete project, here you go
I'm using Docker to run it, with docker-compose up --build
you can test it.
php codeigniter
I want to upload an image, through this form:
<?php echo form_open_multipart('posts/create'); ?>
<div class="form-group">
<label>Title</label>
<input type="text" class="form-control" name="title" placeholder="Add Title" required>
</div>
<div class="form-group">
<label>Body</label>
<textarea id="editor1" class="form-control" name="body" placeholder="Add Body" required></textarea>
</div>
<div class="form-group">
<label>Category</label>
<select name="category_id" class="form-control">
<?php foreach($categories as $category): ?>
<option value="<?php echo $category['id']; ?>"><?php echo $category['name']; ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label>Upload Image</label>
<input type="file" name="userfile" size="20">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
And when I send the information, and I check if the POST petition has the correct data. It doesn't.
It shows me all the inputs expect the file input...
This is the controller, is called Posts and the function is call create.
public function create() {
$data['title'] = 'Create post';
$data['categories'] = $this->post_model->get_categories();
$this->form_validation->set_rules('title', 'Title', 'required');
$this->form_validation->set_rules('body', 'Body', 'required');
if (!$this->form_validation->run()) {
$this->load->view('templates/header');
$this->load->view('posts/create', $data);
$this->load->view('templates/footer');
} else {
// Upload image
$config['upload_path'] = 'assets/images/posts';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 2048;
$config['max_width'] = 2000;
$config['max_height'] = 2000;
$this->load->library('upload', $config);
# Here's where I print the request.
print_r($_POST);
if (!$this->upload->do_upload('userfile')) {
$errors = array('error' => $this->upload->display_errors());
$post_image = 'noimage.jpg';
} else {
$data = array('upload_data' => $this->upload->data());
$post_image = $_FILES['userfile']['name'];
}
echo $post_image;
/* $this->post_model->create_post($post_image);
redirect('posts'); */
}
}
The autoloader.php is configured correctly...
$autoload['helper'] = array('url', 'form', 'text');
If someone needs the complete project, here you go
I'm using Docker to run it, with docker-compose up --build
you can test it.
php codeigniter
php codeigniter
asked Jan 1 at 1:43
Andrés MontoyaAndrés Montoya
9719
9719
The file is in te $_file array
– Lelio Faieta
Jan 1 at 1:50
I print $_FILES and it gives me the right file, check the code and you'll see the error
– Andrés Montoya
Jan 1 at 1:53
It’s the normal behavior that you don’t see the file input in post array. What is your error?
– Lelio Faieta
Jan 1 at 1:55
When I do click in the form, it does not send the file I've uploaded
– Andrés Montoya
Jan 1 at 1:56
Your form is part in the post array and part in the file array. Still don’t see the issue. It is the normal behavior. You say you see both arrays populated so what is the issue?
– Lelio Faieta
Jan 1 at 1:58
|
show 2 more comments
The file is in te $_file array
– Lelio Faieta
Jan 1 at 1:50
I print $_FILES and it gives me the right file, check the code and you'll see the error
– Andrés Montoya
Jan 1 at 1:53
It’s the normal behavior that you don’t see the file input in post array. What is your error?
– Lelio Faieta
Jan 1 at 1:55
When I do click in the form, it does not send the file I've uploaded
– Andrés Montoya
Jan 1 at 1:56
Your form is part in the post array and part in the file array. Still don’t see the issue. It is the normal behavior. You say you see both arrays populated so what is the issue?
– Lelio Faieta
Jan 1 at 1:58
The file is in te $_file array
– Lelio Faieta
Jan 1 at 1:50
The file is in te $_file array
– Lelio Faieta
Jan 1 at 1:50
I print $_FILES and it gives me the right file, check the code and you'll see the error
– Andrés Montoya
Jan 1 at 1:53
I print $_FILES and it gives me the right file, check the code and you'll see the error
– Andrés Montoya
Jan 1 at 1:53
It’s the normal behavior that you don’t see the file input in post array. What is your error?
– Lelio Faieta
Jan 1 at 1:55
It’s the normal behavior that you don’t see the file input in post array. What is your error?
– Lelio Faieta
Jan 1 at 1:55
When I do click in the form, it does not send the file I've uploaded
– Andrés Montoya
Jan 1 at 1:56
When I do click in the form, it does not send the file I've uploaded
– Andrés Montoya
Jan 1 at 1:56
Your form is part in the post array and part in the file array. Still don’t see the issue. It is the normal behavior. You say you see both arrays populated so what is the issue?
– Lelio Faieta
Jan 1 at 1:58
Your form is part in the post array and part in the file array. Still don’t see the issue. It is the normal behavior. You say you see both arrays populated so what is the issue?
– Lelio Faieta
Jan 1 at 1:58
|
show 2 more comments
2 Answers
2
active
oldest
votes
I've tested your code and it is working fine and here is the result of var_dump($_FILES);
:
["userfile"]=>
array(5) {
["name"]=>
string(9) "image.jpg"
["type"]=>
string(10) "image/jpeg"
["tmp_name"]=>
string(23) "C:xampptmpphpB54.tmp"
["error"]=>
int(0)
["size"]=>
int(493443)
}
No problem at all.
BUT keep in mind that you should give $config['upload_path']
a relative path or an absolute path, so you may consider this $config['upload_path'] = './assets/images/posts';
or better this $config['upload_path'] = FCPATH'assets/images/posts';
Did you test with docker? Because docker create a virtual environment... I think is not the same to xampp
– Andrés Montoya
Jan 1 at 2:45
1
The only difference betweenxampp on windows
andlamp on linux
whether it is on physical, virtual or a docker container is the permission on directories, so make sure that you give your directory the right permission (give it 777 for now) .. apart from that, everything in your code works fine.
– user10850918
Jan 1 at 2:51
I have 755 permissions to the html folder github.com/MontoyaAndres/ciblog/blob/master/Dockerfile I'm gonna try 777 and see what happens, thanks and happy New year!
– Andrés Montoya
Jan 1 at 3:03
1
In your application give this pathfull_abs_path_to_your_app/assets/images/posts
a full permission withchmod -R 777 DIR
, try and let me know, happy new year :)
– user10850918
Jan 1 at 3:09
1
@AndrésMontoya .. Great, glad it worked bro :)
– user10850918
Jan 8 at 21:54
|
show 1 more comment
Edit the controller Posts.php and add:
$this->upload->initialize($config);
Was the solution.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992557%2fform-open-multipart-does-not-upload-a-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I've tested your code and it is working fine and here is the result of var_dump($_FILES);
:
["userfile"]=>
array(5) {
["name"]=>
string(9) "image.jpg"
["type"]=>
string(10) "image/jpeg"
["tmp_name"]=>
string(23) "C:xampptmpphpB54.tmp"
["error"]=>
int(0)
["size"]=>
int(493443)
}
No problem at all.
BUT keep in mind that you should give $config['upload_path']
a relative path or an absolute path, so you may consider this $config['upload_path'] = './assets/images/posts';
or better this $config['upload_path'] = FCPATH'assets/images/posts';
Did you test with docker? Because docker create a virtual environment... I think is not the same to xampp
– Andrés Montoya
Jan 1 at 2:45
1
The only difference betweenxampp on windows
andlamp on linux
whether it is on physical, virtual or a docker container is the permission on directories, so make sure that you give your directory the right permission (give it 777 for now) .. apart from that, everything in your code works fine.
– user10850918
Jan 1 at 2:51
I have 755 permissions to the html folder github.com/MontoyaAndres/ciblog/blob/master/Dockerfile I'm gonna try 777 and see what happens, thanks and happy New year!
– Andrés Montoya
Jan 1 at 3:03
1
In your application give this pathfull_abs_path_to_your_app/assets/images/posts
a full permission withchmod -R 777 DIR
, try and let me know, happy new year :)
– user10850918
Jan 1 at 3:09
1
@AndrésMontoya .. Great, glad it worked bro :)
– user10850918
Jan 8 at 21:54
|
show 1 more comment
I've tested your code and it is working fine and here is the result of var_dump($_FILES);
:
["userfile"]=>
array(5) {
["name"]=>
string(9) "image.jpg"
["type"]=>
string(10) "image/jpeg"
["tmp_name"]=>
string(23) "C:xampptmpphpB54.tmp"
["error"]=>
int(0)
["size"]=>
int(493443)
}
No problem at all.
BUT keep in mind that you should give $config['upload_path']
a relative path or an absolute path, so you may consider this $config['upload_path'] = './assets/images/posts';
or better this $config['upload_path'] = FCPATH'assets/images/posts';
Did you test with docker? Because docker create a virtual environment... I think is not the same to xampp
– Andrés Montoya
Jan 1 at 2:45
1
The only difference betweenxampp on windows
andlamp on linux
whether it is on physical, virtual or a docker container is the permission on directories, so make sure that you give your directory the right permission (give it 777 for now) .. apart from that, everything in your code works fine.
– user10850918
Jan 1 at 2:51
I have 755 permissions to the html folder github.com/MontoyaAndres/ciblog/blob/master/Dockerfile I'm gonna try 777 and see what happens, thanks and happy New year!
– Andrés Montoya
Jan 1 at 3:03
1
In your application give this pathfull_abs_path_to_your_app/assets/images/posts
a full permission withchmod -R 777 DIR
, try and let me know, happy new year :)
– user10850918
Jan 1 at 3:09
1
@AndrésMontoya .. Great, glad it worked bro :)
– user10850918
Jan 8 at 21:54
|
show 1 more comment
I've tested your code and it is working fine and here is the result of var_dump($_FILES);
:
["userfile"]=>
array(5) {
["name"]=>
string(9) "image.jpg"
["type"]=>
string(10) "image/jpeg"
["tmp_name"]=>
string(23) "C:xampptmpphpB54.tmp"
["error"]=>
int(0)
["size"]=>
int(493443)
}
No problem at all.
BUT keep in mind that you should give $config['upload_path']
a relative path or an absolute path, so you may consider this $config['upload_path'] = './assets/images/posts';
or better this $config['upload_path'] = FCPATH'assets/images/posts';
I've tested your code and it is working fine and here is the result of var_dump($_FILES);
:
["userfile"]=>
array(5) {
["name"]=>
string(9) "image.jpg"
["type"]=>
string(10) "image/jpeg"
["tmp_name"]=>
string(23) "C:xampptmpphpB54.tmp"
["error"]=>
int(0)
["size"]=>
int(493443)
}
No problem at all.
BUT keep in mind that you should give $config['upload_path']
a relative path or an absolute path, so you may consider this $config['upload_path'] = './assets/images/posts';
or better this $config['upload_path'] = FCPATH'assets/images/posts';
answered Jan 1 at 2:22
user10850918user10850918
336
336
Did you test with docker? Because docker create a virtual environment... I think is not the same to xampp
– Andrés Montoya
Jan 1 at 2:45
1
The only difference betweenxampp on windows
andlamp on linux
whether it is on physical, virtual or a docker container is the permission on directories, so make sure that you give your directory the right permission (give it 777 for now) .. apart from that, everything in your code works fine.
– user10850918
Jan 1 at 2:51
I have 755 permissions to the html folder github.com/MontoyaAndres/ciblog/blob/master/Dockerfile I'm gonna try 777 and see what happens, thanks and happy New year!
– Andrés Montoya
Jan 1 at 3:03
1
In your application give this pathfull_abs_path_to_your_app/assets/images/posts
a full permission withchmod -R 777 DIR
, try and let me know, happy new year :)
– user10850918
Jan 1 at 3:09
1
@AndrésMontoya .. Great, glad it worked bro :)
– user10850918
Jan 8 at 21:54
|
show 1 more comment
Did you test with docker? Because docker create a virtual environment... I think is not the same to xampp
– Andrés Montoya
Jan 1 at 2:45
1
The only difference betweenxampp on windows
andlamp on linux
whether it is on physical, virtual or a docker container is the permission on directories, so make sure that you give your directory the right permission (give it 777 for now) .. apart from that, everything in your code works fine.
– user10850918
Jan 1 at 2:51
I have 755 permissions to the html folder github.com/MontoyaAndres/ciblog/blob/master/Dockerfile I'm gonna try 777 and see what happens, thanks and happy New year!
– Andrés Montoya
Jan 1 at 3:03
1
In your application give this pathfull_abs_path_to_your_app/assets/images/posts
a full permission withchmod -R 777 DIR
, try and let me know, happy new year :)
– user10850918
Jan 1 at 3:09
1
@AndrésMontoya .. Great, glad it worked bro :)
– user10850918
Jan 8 at 21:54
Did you test with docker? Because docker create a virtual environment... I think is not the same to xampp
– Andrés Montoya
Jan 1 at 2:45
Did you test with docker? Because docker create a virtual environment... I think is not the same to xampp
– Andrés Montoya
Jan 1 at 2:45
1
1
The only difference between
xampp on windows
and lamp on linux
whether it is on physical, virtual or a docker container is the permission on directories, so make sure that you give your directory the right permission (give it 777 for now) .. apart from that, everything in your code works fine.– user10850918
Jan 1 at 2:51
The only difference between
xampp on windows
and lamp on linux
whether it is on physical, virtual or a docker container is the permission on directories, so make sure that you give your directory the right permission (give it 777 for now) .. apart from that, everything in your code works fine.– user10850918
Jan 1 at 2:51
I have 755 permissions to the html folder github.com/MontoyaAndres/ciblog/blob/master/Dockerfile I'm gonna try 777 and see what happens, thanks and happy New year!
– Andrés Montoya
Jan 1 at 3:03
I have 755 permissions to the html folder github.com/MontoyaAndres/ciblog/blob/master/Dockerfile I'm gonna try 777 and see what happens, thanks and happy New year!
– Andrés Montoya
Jan 1 at 3:03
1
1
In your application give this path
full_abs_path_to_your_app/assets/images/posts
a full permission with chmod -R 777 DIR
, try and let me know, happy new year :)– user10850918
Jan 1 at 3:09
In your application give this path
full_abs_path_to_your_app/assets/images/posts
a full permission with chmod -R 777 DIR
, try and let me know, happy new year :)– user10850918
Jan 1 at 3:09
1
1
@AndrésMontoya .. Great, glad it worked bro :)
– user10850918
Jan 8 at 21:54
@AndrésMontoya .. Great, glad it worked bro :)
– user10850918
Jan 8 at 21:54
|
show 1 more comment
Edit the controller Posts.php and add:
$this->upload->initialize($config);
Was the solution.
add a comment |
Edit the controller Posts.php and add:
$this->upload->initialize($config);
Was the solution.
add a comment |
Edit the controller Posts.php and add:
$this->upload->initialize($config);
Was the solution.
Edit the controller Posts.php and add:
$this->upload->initialize($config);
Was the solution.
answered Jan 2 at 17:31
Andrés MontoyaAndrés Montoya
9719
9719
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992557%2fform-open-multipart-does-not-upload-a-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The file is in te $_file array
– Lelio Faieta
Jan 1 at 1:50
I print $_FILES and it gives me the right file, check the code and you'll see the error
– Andrés Montoya
Jan 1 at 1:53
It’s the normal behavior that you don’t see the file input in post array. What is your error?
– Lelio Faieta
Jan 1 at 1:55
When I do click in the form, it does not send the file I've uploaded
– Andrés Montoya
Jan 1 at 1:56
Your form is part in the post array and part in the file array. Still don’t see the issue. It is the normal behavior. You say you see both arrays populated so what is the issue?
– Lelio Faieta
Jan 1 at 1:58