PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, August 28, 2022

[FIXED] How to upload a .csv file to GCP storage using Julia

 August 28, 2022     csv, julia     No comments   

Issue

I want to write a .csv file in GCP storage directly from Julia.


Solution

GoogleCloud.jl supports this functionality and all steps can be found in it's tutorial

I cite it here but look at the tutorial's version.

using GoogleCloud
creds = JSONCredentials("credentials.json")
session = GoogleSession(creds, ["devstorage.full_control"])
set_session!(storage, session)    # storage is the API root, exported from GoogleCloud.jl
file_contents = readstring(open("file.csv", "r"));
storage(:Object, :insert, "a12345foo";     # Returns metadata about the object
    name="file.csv", 
    data=file_contents,      
    content_type="text/csv" 
)


Answered By - Przemyslaw Szufel
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing