Skip to content
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

Failed - No File [BUG] #56

Closed
packytagliaferro opened this issue Jul 3, 2019 · 11 comments
Closed

Failed - No File [BUG] #56

packytagliaferro opened this issue Jul 3, 2019 · 11 comments

Comments

@packytagliaferro
Copy link

  • [ X] Able to reproduce the behaviour outside of your code, the problem is isolated to Laravel Excel.
  • [ X] Checked that your issue isn't already filed.
  • [ X] Checked if no PR was submitted that fixes this problem.

Versions

  • PHP version: 7.2
  • Laravel version: 5.8
  • Nova version: 2.0.9
  • Package version: 1.1

Description

I am having this same issue. It just says "Failed - No File" in chrome. I have added the package manually in app.php, although auto discovery is on in my project, but still nothing. The response I get back from the package is:

download: "http://reflect.test/nova-vendor/maatwebsite/laravel-nova-excel/download?path=%2Fprivate%2Fvar%2Ftmp%2Flaravel-excel-9kHdcVh2sPrFf2vYUdgTsLmVpVW304ct&filename=users.csv"
name: "users.csv"

Steps to Reproduce

Followed installation guide
Clicked 1 user to download CSV or XLS file
Click Action Button
File download fails

Tried fix from issue #11 but did not work.

File to be downloaded

Actual behavior:

Error downloading. Says no file and the link in the response returns a 404

@GlennM
Copy link

GlennM commented Jul 4, 2019

I can't reproduce this locally. The response you're reporting looks similar to the (200) response I get.

Could you please share the code from the actions method on the User Resource?
(and make sure you're using / imported aatwebsite\LaravelNovaExcel\Actions\DownloadExcel;)

@packytagliaferro
Copy link
Author

In my User.php

use Maatwebsite\LaravelNovaExcel\Actions\DownloadExcel;


 public function actions(Request $request)
    {
        return [
            (new DownloadExcel())->askForWriterType()
        ];
    }

@packytagliaferro
Copy link
Author

I got it working. My web routes file was blocking the nova-vendor path. You can close this issue, it wasnt related to the plugin

@kaleb14587
Copy link

@packytagliaferro
how did you solve it?
I have exactly the same error, but it only happens in my production environment.

@packytagliaferro
Copy link
Author

@kaleb14587 Mine was due to my web routes ignoring some urls for my app( /channel/) and it ended up blocking nova routes too so I wrapped in routes like this:

Route::group([
    'middleware' => ['subscriber'],
    'where' => [
        'channel' => '^(?!nova-api|nova-vendor|admin.*$).*'
    ],
], function () {

    //My web routes here

});

Was a pretty one off case but could help?

@kaleb14587
Copy link

@packytagliaferro I've done everything, but the error only happens in my production environment, in the homologation and development environment it doesn't happen

@kaleb14587
Copy link

kaleb14587 commented Mar 30, 2020

@ kaleb14587 O meu foi devido às minhas rotas da Web que ignoravam alguns URLs do meu aplicativo (/ channel /) e ele acabou bloqueando novas rotas também, então envolvi-me em rotas como esta:

Route::group([
    'middleware' => ['subscriber'],
    'where' => [
        'channel' => '^(?!nova-api|nova-vendor|admin.*$).*'
    ],
], function () {

    //My web routes here

});

Foi um caso bonito, mas poderia ajudar?

I tried this method too, but it still doesn't work, it returns me exactly this error you had.
I even tried to rewrite the route, but it doesn't send it to the controller I created.

@kaleb14587
Copy link

@packytagliaferro
I just found out that this happens when I activate the ssl certificate

@arifulhb
Copy link

@kaleb14587 how did you fixed this?

@jayge-ekenstam
Copy link

I am dealing with the same issue in production only. Has anyone figured out what is causing this?

@shstkvch
Copy link

I managed to solve this issue by adjusting my Nginx config: https://stackoverflow.com/a/56738758

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants