goodby / csv

Goodby CSV is a high memory efficient flexible and extendable open-source CSV import/export library for PHP 5.3. 1. Memory Management Free This library designed for memory unbreakable. It will not be accumulated in the memory whole rows. The importer read CSV file and execute callback function line by line. 2. Multibyte support This library supports mulitbyte input/output: for example, SJIS-win, EUC-JP and UTF-8. 3. Ready to Use for Enterprise Applications Goodby CSV is fully unit-tested. The library is stable and ready to be used in large projects like enterprise applications.
MIT License
955 stars 148 forks source link

reading amazon s3 file #74

Closed chrisvidal closed 6 years ago

chrisvidal commented 6 years ago

Hi, how would we read a file stored on a amazon s3 services? I saw that the method parse is accepting a string and then the method is using a SplFileObject PHP class to handle the file. I didnt have time to try yet, Would that work or will I need any adaptation ?

thanks

suin commented 6 years ago

@chrisvidal I have never tried that, but I think you will be able to read the CSV file after you download it from S3 bucket and store it as a temporary file in your EC2 instance.

chrisvidal commented 6 years ago

Thanks @suin for your answer my issue is that I am having an Autoscaling config, so I might have 2 EC2 instances and I wont know which one is used after the copy. Does my question make sense ?

suin commented 6 years ago

@chrisvidal I don't think that there is problem, even if some autoscaled-instances share, copy and read a same file. To make it clear, could you tell me a specific use case which makes problems?

chrisvidal commented 6 years ago

and how would i copy the file from the s3 bucket to the hard disk of my server?

suin commented 6 years ago

@chrisvidal

how would i copy the file from the s3 bucket to the hard disk of my server?

Here is tutorial to download S3 object to the hard disk. Get an Object Using the AWS SDK for PHP - Amazon Simple Storage Service

chrisvidal commented 6 years ago

thanks @suin I will try to implement that over the week then the CSV file import should follow the same principle in that case.