Uploading Files To Asp.net Core Api?
up vote
0
down vote
favorite
I tried different ways(through plugins and via my own code) but I can't get the image to upload
@observable
images = ;
@action
onDrop(files)
this.images = files;
<DropzoneonDrop=this.onDrop.bind(this)>
<p>Try dropping some files here, or click to select files to upload.</p>
</Dropzone>
var images = new FormData();
images.append("1", image[0]);
const response = yield self
.rootStore()
.axios.post('/Items/Post',
images: images
);
[HttpPost("Post")]
public void Post(IList<IFormFile> images)
but images is always an empty object() that gets sent to the server
javascript reactjs asp.net-core axios
add a comment |
up vote
0
down vote
favorite
I tried different ways(through plugins and via my own code) but I can't get the image to upload
@observable
images = ;
@action
onDrop(files)
this.images = files;
<DropzoneonDrop=this.onDrop.bind(this)>
<p>Try dropping some files here, or click to select files to upload.</p>
</Dropzone>
var images = new FormData();
images.append("1", image[0]);
const response = yield self
.rootStore()
.axios.post('/Items/Post',
images: images
);
[HttpPost("Post")]
public void Post(IList<IFormFile> images)
but images is always an empty object() that gets sent to the server
javascript reactjs asp.net-core axios
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I tried different ways(through plugins and via my own code) but I can't get the image to upload
@observable
images = ;
@action
onDrop(files)
this.images = files;
<DropzoneonDrop=this.onDrop.bind(this)>
<p>Try dropping some files here, or click to select files to upload.</p>
</Dropzone>
var images = new FormData();
images.append("1", image[0]);
const response = yield self
.rootStore()
.axios.post('/Items/Post',
images: images
);
[HttpPost("Post")]
public void Post(IList<IFormFile> images)
but images is always an empty object() that gets sent to the server
javascript reactjs asp.net-core axios
I tried different ways(through plugins and via my own code) but I can't get the image to upload
@observable
images = ;
@action
onDrop(files)
this.images = files;
<DropzoneonDrop=this.onDrop.bind(this)>
<p>Try dropping some files here, or click to select files to upload.</p>
</Dropzone>
var images = new FormData();
images.append("1", image[0]);
const response = yield self
.rootStore()
.axios.post('/Items/Post',
images: images
);
[HttpPost("Post")]
public void Post(IList<IFormFile> images)
but images is always an empty object() that gets sent to the server
javascript reactjs asp.net-core axios
javascript reactjs asp.net-core axios
asked Nov 9 at 21:06
chobo2
30k151398676
30k151398676
add a comment |
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233266%2fuploading-files-to-asp-net-core-api%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