2

I want to download some content in csv format. It is stored online in a csv file. I can not just read the content. I first have to download the file, open and then read it.

Is there a way to open it directly? Or do I have to first load/upload it on my server and then open it like a classic file?

1

2 Answers 2

8

Yes, it can open directly using fopen and fgetcsv

However, this feature sometime is restricted for security concern, and you can read the details via the documentation

Another drawback of open directly, if the page is processed many time, which mean it generate lots of network transfer overhead, and potentially slow down your page generation time.

Ideal case will be download into your server, and repeated use local disk file for processing, that will save some network bandwidth.

Sign up to request clarification or add additional context in comments.

Comments

1

Check out fgetcsv() and str_getcsv()

1 Comment

Link-only answers are low value on Stackoverflow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.