Support the ongoing development of Laravel.io →
Cache Database Eloquent
Last updated 2 years ago.
0

Have you tried splitting up the CSV files into multiple files?

0

do you mean that i have to do that using PHP ? the user is the one uploading the files, if i do that using PHP i think it would dublicate the file in the cache memory and make it crashes even earlier... no ?

0

One way would be:

  1. when the user uploads the file, store them in a directory e.g. uploads/username/files

  2. run a cron job (every 5 minutes) to go through these files, if i remember correctly cron jobs run in command line, so there is no timelimit issues..

If you happen to still get time out issues, then you could split the file into several files..

0

Did you try using DB::insert()? Should be a bit lighter than eloquent. I would still disable the logging though.

0

If you only want to insert that file for once and need not anything changed to the data itself, I would suggest using load data instead.

http://stackoverflow.com/questions/14127529/mysql-import-data-from-csv-using-load-data-infile

http://www.mysqltutorial.org/import-csv-file-mysql-table/

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.