Solved

open Zip and CSV files with php?

Posted on 2011-03-14
3
311 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

777 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