question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Posting empty array

See original GitHub issue

Hi all, I am trying to upload a excel file using axios and php. when I post a file with axios I getting empty post array at php side my code

            var formdata = new FormData();
            var filedata = document.getElementById('file-upload').files[0];
            formdata.append('paymentfile',filedata);
            const result = uploadFile(formdata);
            result.then(function(response){
            }


//my uploadFile function is like 
  
 const confi = {
        headers: { 'content-type': 'multipart/form-data' }
    }
    const url = "http://localhost/codeigniter/user/uploadExcel";
   return axios.post(url,data,confi); 

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14

github_iconTop GitHub Comments

1reaction
kailashjakharcommented, Feb 2, 2018

Thanks @naxir for your kind of response. But still i am getting Empty Array

0reactions
github-actions[bot]commented, Oct 19, 2020

Hello! 👋

This issue is being automatically marked as stale because it has not been updated in a while. Please confirm that the issue is still present and reproducible. If no updates or new comments are received the issue will be closed in a few days.

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

php $_POST array empty upon form submission
Another simple reason for an empty POST array can be caused by not closing a form with </ ...
Read more >
Post with empty array in form removes the property #2740
This is bad for me, it removes properties from the form. I'm trying to send an object with a property holding an array...
Read more >
empty - Manual
Determine whether a variable is considered to be empty. A variable is considered empty if it does not exist or if its value...
Read more >
Best way to initialize empty array in PHP
While push an element to the array it can use $emptyArray[] = “first”. At this time, $emptyArray contains “first”, with this command and...
Read more >
Empty $_POST array JS to PHP AJAX
No clue why this is happening, i have a form on my website that i submit to a php script using JQUERY and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found