-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[QUESTION] XLS export not working #762
Comments
Hi, I've encountered the same bug. FileController.php
This code works like a charm with csv extension not xls or xlsx. Here is my setup: I'm pretty sure i've removed all trailling spaces before <?php and at the end of files, I've checked for like 2 hours more or less even in files that is probably not parsed in this case. No offense, but this should be highly considered as a bug to fixe. Thanks for your work and attention, I really like to use Laravel-excel even if I'm still struggling to get some of the implemented feature to work as planned |
I am facing a similar issue, with Laravel 5.2. Storing the file (XLS/XLSX) works fine, however the download('xlsx') function returns a corrupted file. |
Trust me on this one, it's a problem with spaces as they get prepended/appended to the stream. Everybody who had this issue in the end found a space somewhere. You have to check all files, not only the once which get called. It's not a bug, if you remove the incorrect spaces (which shouldn't be there in the first place) it will work fine. As well it's not a problem with this package, but with the parent package PHPExcel, if you do it with that package you will get the exact same error. Nothing we can do on this side. |
Indeed that was a wrong space from my end. |
Please once i upgraded to php7, i keep having this site cannot be reached in chrome with an ERR_INVALID_RESPONSE. Please is there anything am supposed to add or remove?? |
it works on windows but not after i uploaded it to my linux server. please check out this url. http://jabu-portal.com.ng/test/excel it downloaded once and then it starts giving file not found error. |
This is the code for the test page
|
i am facing same problem in my current application. But the problem is i wrote the same code in two different methods, but its working in one method and not in the other one. Not working method: |
have the same issue---basically download csv works fine on my local development enviroment[ LAMP on windows+php5.6+Laravel 5.3 ]but got ERR_INVALID_RESPONSE on my remote production server. ubuntu, nginx+php7,0+laravel5.3... any ideas? |
@topegret download php7.0-zip to download the zip archive or change 'xslx' to 'xls' that's what I did an it worked. |
@LordRahl90 I had the same issue in exporting xlsx only, but installing php7.0-zip solved my problem. Well done brother |
I checked mine, it was php 7.0 zip and I only need csv file... |
do we have a solution for this? Thank you for any help! |
@edanao, try cleanin the buffer before calling download function. There must be some space symbol in the code which triggers the error.
|
Yeah. I have a walk around on this. basically I wrote my own stuff. I once
read an article after i have my own solution. it seems the nginx folder(s)
have permission set wrong. but I did not test it.
…On Wed, Apr 5, 2017 at 11:43 AM, vitaliyb ***@***.***> wrote:
@edanao <https://github.com/edanao>, try cleanin the buffer before
calling download function. There must be some space symbol in the code
which triggers the error.
if (ob_get_level() > 0) { ob_end_clean(); }
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#762 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJqw_Xy1YDT-MAFLz8t6eDJNUD8-jn8Yks5rs8SVgaJpZM4IGjGg>
.
|
@topegret What is the way you solved? |
Thank you @vitaliyb and @topegret ! |
Finally, I have found the issue by config to /tmp folder of project. |
Hi, i had the similar error, in the following code :
The File name($name) and sheet name(Sheet 1) should Not contain any space. After removing space, everything worked like a charm. Cheers. |
Thank you @vitaliyb |
Thanks it worked For Me |
Great tip, thanks a lot! |
if (ob_get_level() > 0) { ob_end_clean(); } Great tip, thanks a lot! |
//if your exported exec file not opening or showing not valid extension |
I've read through the older issues about the blank space prior to the <?php. But I've searched and could not find any in the controller, model, and route in relation to the export call.
I'm using the latest Laravel, & Laravel-Excel Package.
My Link code;
My export code;
When I try to open the file. It is corrupt. This same code works fine with CSV
The text was updated successfully, but these errors were encountered: