-
-
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
[BUG] 'File not found at path' when importing file on server while file_exists($path) returns true #1827
Comments
@mattias-persson See Importing from default disk for more information how to deal with the files you'd like to import. |
Ah, my bad. I missed that part of the docs. Thank you! |
i have same trouble, :( controller: with('success', "Import data succesfull"); } } and My class or model: $row[0], 'nama_mahasiswa' => $row[1], 'jenis_kelamin' => $row[2], 'tanggal_lahir' => $row[3], ]); } } and the error: League \ Flysystem \ FileNotFoundException File not found at path: Mahasiswa.xlsx and: public function assertPresent($path) { if ($this->config->get('disable_asserts', false) === false && ! $this->has($path)) { throw new FileNotFoundException($path); } } whats wrong on my work :( |
hmmm namespace App\Http\Controllers\Admin; use App\Model\Mahasiswa; class UserimController extends Controller
` class or model: namespace App\Model; use App\Mahasiswa; |
and this error
|
@GlennM please help me :( |
hi, I meet the same question, and i am sure my file has been uploaded at the right url i using |
@williams-young Could you please open a new issue (according to the issue template) mentioning all relevant information? Thanks! |
This is not a bug. Put your excel file in "storage/app" folder. it use default disk config in config/filesystems.php |
xxxxxxxxxxxxxxxxxxx\storage\app |
Please post any support related questions or comments in English please if you would like us to provide support. |
I understand that this behavior is documented, but again it just seems bizarre and unintuitive. If you pass it an absolute filePath that comes back as true from file_exists()....it should load. There seems to be many unnecessary "gotchas" with this package, even when trying to do very basic import operations. I have a 4 column XLSX with 100 rows that I want to import into a collection. I've had to visit the forums for filePath issues, dates coming back as integers, and trying to figure out what the point of these generated XYZImport classes are when I am trying to import a small xlsx to a collection. |
I agree on this. Seems like it causes confusion for a lot of users. |
I agree on this being confusing. Can't the documentation mention the default |
If you think the documentation lacks some information, you're always welcome to submit a pull request to the docs. You can do so by using the |
count me in with the confused.. was trying to pass an absolute path using base_path() since my files are stored outside the storage folder and in a special "modules" folder.. couldn't get it to work, finally had to move my files into the storage path. If the path received starts with a front slash it should just assume that it's an absolute path IMO |
Yeah, actually it seems that even after adding files to storage it can't find it. Judging by the error response it's trying a relative path in the end 🤦♂️ . |
It has been documented for a few months that using absolute paths is possible: https://docs.laravel-excel.com/3.1/imports/basics.html#importing-full-path I'll lock this ticket to keep the support process streamlined. If new bugs or questions arise, please create a new issue explaining your specific case. |
Prerequisites
Versions
Description
When I try following the documentation on importing a file stored on the server, I get an
Illuminate\Contracts\Filesystem\FileNotFoundException
sayingFile not found at path: [path to file]
. However, afile_exists($path);
returns true.Steps to Reproduce
php artisan make:import UsersImport --model=User
.Expected behavior:
According to the docs, the rows in the file should be imported to the users table.
Actual behavior:
Illuminate\Contracts\Filesystem\FileNotFoundException: File not found at path: [path]
The text was updated successfully, but these errors were encountered: