Solved

open Zip and CSV files with php?

Posted on 2011-03-14
3
310 Views
Last Modified: 2012-05-11
I want to send an api request using the youtube api but I am unsure how I would be able to read the information returned by the request.

Youtube states that the request will return a zip file with a bunch of .csv files in it depending on your request.

Is it practical to think that I will be able to send the request read the zip file and grab the contents of the .csv files on the fly?

This is stuff that I want to be accessible to those that will be logged in to my app. Could php do this type of action and quickly?

Here is the link to the google/youtube api that is specific to my question. Thanks.

http://code.google.com/apis/youtube/2.0/developers_guide_protocol_insight.html
0
Comment
Question by:Solutionabc
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
dsmile earned 500 total points
ID: 35135003
There're many classes available for you to unzip & read csv using php.
Just google it or go here http://www.phpclasses.org/

For the unzip part, I suggest that you use unzip tool on your server (gzip on Linux or 7z on both Linux and Windows) to get highest performance.

And the scenario should be like this:
1. request youtube api to get and save zip file to you host.
2. unzip zip file
3. loop through csv and read the content then return to user
0
 

Author Comment

by:Solutionabc
ID: 35135090
Preferably I would want the information inside the zip file to be available as soon as the person logs in. Would there be a time delay in downloading the zip and reading the content?
0
 
LVL 13

Expert Comment

by:dsmile
ID: 35136386
I think the only delay is time consumed by saving the zip file to your host.
That "on-the-fly" you're talking about may result in incomplete zip file that couldn't be openned anyway.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now