Solved

open Zip and CSV files with php?

Posted on 2011-03-14
3
313 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Force PDF to open inline as opposed to dowload 16 35
MySqli Real Escape String and SQL Injection 1 44
MySQL Persistent Connections 10 32
Special characters in a TCPDF 4 25
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

756 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