Solved

open Zip and CSV files with php?

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Need some help setting up PDFLib 4 26
html input clean up 3 30
Creating a slider 12 34
Tracking Bouncebacks in PHPMailer 2 4
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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 dynamically set the form action using jQuery.

708 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

11 Experts available now in Live!

Get 1:1 Help Now