# Downloading CSV from web server

**URL:** https://discourse.processing.org/t/downloading-csv-from-web-server/12286
**Category:** Coding Questions
**Created:** [June 25, 2019, 7:48pm UTC](https://discourse.processing.org/t/downloading-csv-from-web-server/12286 "2019-06-25T19:48:26Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![pablogott](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pablogott](https://discourse.processing.org/u/pablogott)
#### Post date: [June 25, 2019, 7:48pm UTC](https://discourse.processing.org/t/downloading-csv-from-web-server/12286/1 "2019-06-25T19:48:27Z")

</div>

I have a CSV that constantly gets updated on a web server. How can I download the data? I already have code for processing if the data exists locally, but I’d rather not have to store it locally and just read it from the web server. Is this even possible?

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [June 25, 2019, 8:43pm UTC](https://discourse.processing.org/t/downloading-csv-from-web-server/12286/2 "2019-06-25T20:43:16Z")

</div>

Hey and welcome in this great community!

Look here

[https://www.processing.org/reference/loadStrings\_.html](https://www.processing.org/reference/loadStrings_.html)

---

<div class="post-metadata">

### Author: ![pablogott](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pablogott](https://discourse.processing.org/u/pablogott)
#### Post date: [June 25, 2019, 10:33pm UTC](https://discourse.processing.org/t/downloading-csv-from-web-server/12286/3 "2019-06-25T22:33:16Z")

</div>

Thanks! That works - but any idea what I can do if I have to manually allow a certificate? I can pull my csv data in a browser, but I get:

```auto

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1946)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:316)
NullPointerException
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:310)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1639)
	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:223)
	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1037)
	at sun.security.ssl.Handshaker.process_record(Handshaker.java:965)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1064)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
	at processing.core.PApplet.createInputRaw(PApplet.java:7145)
	at processing.core.PApplet.createInputRaw(PApplet.java:7150)
	at processing.core.PApplet.createInput(PApplet.java:7098)
	at processing.core.PApplet.loadStrings(PApplet.java:7561)
	at sketch_190625a.setup(sketch_190625a.java:17)
	at processing.core.PApplet.handleDraw(PApplet.java:2425)
	at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
	at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:397)
	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:240)
	at sun.security.validator.Validator.validate(Validator.java:262)
	at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1621)
	... 21 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
	at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
	at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:392)
	... 27 more
The file "<https://server.com/file.csv>" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.

```

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [June 26, 2019, 10:40am UTC](https://discourse.processing.org/t/downloading-csv-from-web-server/12286/4 "2019-06-26T10:40:12Z")

</div>

I don’t know

@GoToLoop ?

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [June 26, 2019, 11:00am UTC](https://discourse.processing.org/t/downloading-csv-from-web-server/12286/5 "2019-06-26T11:00:28Z")

</div>

> [@pablogott](#):
>
> [https://server.com/file.csv](https://server.com/file.csv)

also not see a file there…

anyhow you not load a CSV file with loadStrings,  
a table fits much better, look at all that features available for this:

> **[Table / Reference](https://processing.org/reference/Table.html)**
>
> Table objects store data with multiple rows and columns, much like in a traditional spreadsheet. Tables can be generated from scratch, dynamically, or using data from an existing file. Tables c…

> **[loadTable() / Reference](https://processing.org/reference/loadTable_.html)**
>
> Reads the contents of a file or URL and creates a Table object with its values. If a file is specified, it must be located in the sketch's "data" folder. The filename parameter can also be a URL to a …

```auto
Table table;

void setup() { 
  table = loadTable("http://kll.engineering-news.org/kllfusion01/downloads/song.csv"); //, "header");
  println(table.getRowCount() + " total rows in table"); 
}

```

---

<div class="post-metadata">

### Author: ![pablogott](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pablogott](https://discourse.processing.org/u/pablogott)
#### Post date: [June 26, 2019, 8:20pm UTC](https://discourse.processing.org/t/downloading-csv-from-web-server/12286/6 "2019-06-26T20:20:38Z")

</div>

Yes, loadTable() is much better. Thank you. Unfortunately I still can’t get past the ssl errors. And just for clarity, I removed my actual server and just put this in:  
“[https://server.com/file.csv](https://server.com/file.csv)” as a placeholder.
