Uncaught TypeError: Illegal invocation Upload File
up vote
1
down vote
favorite
i get a problem when upload file image use front-end ReactJS and back-end PHP.
onChange in form
onImageChange: function (e) {
e.preventDefault();
this.setState({
image: e.target.files[0]
});
},
Send data to back-end
$.post('api/update.php', {
image: this.state.image
},
function(res) {
this.setState({successUpdate: res});
}.bind(this));
e.preventDefault();
Back-end (PHP)
$product->image = $_FILES['image']['name'];
$product->id = $_POST['id'];
$result = $product->create() ? "true" : 'false';
The problem was :
1. Uncaught TypeError: Illegal invocation
2. how to get the image data (directory, name, size, etc) using php from reactjs
javascript php jquery ajax reactjs
add a comment |
up vote
1
down vote
favorite
i get a problem when upload file image use front-end ReactJS and back-end PHP.
onChange in form
onImageChange: function (e) {
e.preventDefault();
this.setState({
image: e.target.files[0]
});
},
Send data to back-end
$.post('api/update.php', {
image: this.state.image
},
function(res) {
this.setState({successUpdate: res});
}.bind(this));
e.preventDefault();
Back-end (PHP)
$product->image = $_FILES['image']['name'];
$product->id = $_POST['id'];
$result = $product->create() ? "true" : 'false';
The problem was :
1. Uncaught TypeError: Illegal invocation
2. how to get the image data (directory, name, size, etc) using php from reactjs
javascript php jquery ajax reactjs
$_FILES['image']['tmp_name'];
– Lithilion
2 days ago
@Lithilion, still error,Uncaught TypeError: Illegal invocation.
– J.P
2 days ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
i get a problem when upload file image use front-end ReactJS and back-end PHP.
onChange in form
onImageChange: function (e) {
e.preventDefault();
this.setState({
image: e.target.files[0]
});
},
Send data to back-end
$.post('api/update.php', {
image: this.state.image
},
function(res) {
this.setState({successUpdate: res});
}.bind(this));
e.preventDefault();
Back-end (PHP)
$product->image = $_FILES['image']['name'];
$product->id = $_POST['id'];
$result = $product->create() ? "true" : 'false';
The problem was :
1. Uncaught TypeError: Illegal invocation
2. how to get the image data (directory, name, size, etc) using php from reactjs
javascript php jquery ajax reactjs
i get a problem when upload file image use front-end ReactJS and back-end PHP.
onChange in form
onImageChange: function (e) {
e.preventDefault();
this.setState({
image: e.target.files[0]
});
},
Send data to back-end
$.post('api/update.php', {
image: this.state.image
},
function(res) {
this.setState({successUpdate: res});
}.bind(this));
e.preventDefault();
Back-end (PHP)
$product->image = $_FILES['image']['name'];
$product->id = $_POST['id'];
$result = $product->create() ? "true" : 'false';
The problem was :
1. Uncaught TypeError: Illegal invocation
2. how to get the image data (directory, name, size, etc) using php from reactjs
javascript php jquery ajax reactjs
javascript php jquery ajax reactjs
edited 2 days ago
executable
768220
768220
asked 2 days ago
J.P
112
112
$_FILES['image']['tmp_name'];
– Lithilion
2 days ago
@Lithilion, still error,Uncaught TypeError: Illegal invocation.
– J.P
2 days ago
add a comment |
$_FILES['image']['tmp_name'];
– Lithilion
2 days ago
@Lithilion, still error,Uncaught TypeError: Illegal invocation.
– J.P
2 days ago
$_FILES['image']['tmp_name'];
– Lithilion
2 days ago
$_FILES['image']['tmp_name'];
– Lithilion
2 days ago
@Lithilion, still error,Uncaught TypeError: Illegal invocation.
– J.P
2 days ago
@Lithilion, still error,Uncaught TypeError: Illegal invocation.
– J.P
2 days ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203269%2funcaught-typeerror-illegal-invocation-upload-file%23new-answer', 'question_page');
}
);
Post as a guest
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
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
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
$_FILES['image']['tmp_name'];
– Lithilion
2 days ago
@Lithilion, still error,Uncaught TypeError: Illegal invocation.
– J.P
2 days ago