# Can I upload an image to the web?

**URL:** <https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222>\
**Category:** Project Guidance\
**Created:** [November 4, 2019, 4:51pm UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222 "2019-11-04T16:51:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhoenixStormJr](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@PhoenixStormJr](https://discourse.processing.org/u/PhoenixStormJr)\
**Post date:** [November 4, 2019, 4:51pm UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222/1 "2019-11-04T16:51:57Z")

</div>

Ok this isn’t a question about the code itself. In processing examples there’s one where they download an image from the internet and display it. My question is “is there a website that I can upload an image and use it’s link in my code?”

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 4, 2019, 6:02pm UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222/2 "2019-11-04T18:02:02Z")

</div>

You mean uploading by code? Or just upload it to a cloud like for instance Drive, where you can share the link and use it to download?

---

<div class="post-metadata">

**Author:** ![PhoenixStormJr](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@PhoenixStormJr](https://discourse.processing.org/u/PhoenixStormJr)\
**Post date:** [November 4, 2019, 8:16pm UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222/3 "2019-11-04T20:16:56Z")

</div>

Not uploading by code. A website that I can manually upload pictures and use the picture link in my code. Upload manually and manually get a link that I can use in my code. Google drive doesn’t seem to work.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 4, 2019, 8:48pm UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222/4 "2019-11-04T20:48:30Z")

</div>

Of cours it works. After uploading your file you search for the uploaded file and click on the three dots where you can choose “share”. The link will be copied to your clipboard.

---

<div class="post-metadata">

**Author:** ![PhoenixStormJr](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@PhoenixStormJr](https://discourse.processing.org/u/PhoenixStormJr)\
**Post date:** [November 8, 2019, 3:09am UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222/5 "2019-11-08T03:09:12Z")

</div>

Sorry it took so long but here’s the code… the picture is a game character and to save space i wanted to load from the internet… the code returns an error “could not find a method to load ‘link’” any idea on a good website? Google drive crashes.

```auto
/**
 * Loading Images. 
 * 
 * Processing applications can load images from the network. 
 * 
 */

PImage img;

void setup() {
  size(640, 360);
  img = loadImage("https://drive.google.com/open?id=1dda0l4N2eWjT_tSlMooI53NV3j8LrkNW");
  noLoop();
}

void draw() {
  background(0);
  if (img != null) {
    for (int i = 0; i < 5; i++) {
      image(img, 0, img.height * i);
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [November 8, 2019, 12:59pm UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222/6 "2019-11-08T12:59:07Z")

</div>

Hi,

I think you need a direct link to your image like `"https://url_to_your_img.png"`.  
I don’t know if it’s possible with Google Drive but you can use other image hosting websites like Imgur, Flickr, tinyPic or DropBox…

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 8, 2019, 2:25pm UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222/7 "2019-11-08T14:25:49Z")

</div>

I have tried it with DropBox also.  
Both of them use java script for transfer.  
Even if you try to download a text with loadStrings() it will give you an output. But it’s java script.  
If you download a “clean file” it will work.  
Try

```auto
String[] lines = loadStrings("https://www.w3.org/TR/PNG/iso_8859-1.txt"); 
  println("there are " + lines.length + " lines"); 
  for (int i = 0; i < lines.length; i++) { 
    println(lines[i]);
  }

```

So I think you have to have it stored on own domain.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 8, 2019, 2:37pm UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222/8 "2019-11-08T14:37:42Z")

</div>

We never give up!!  
I found a way.  
Simply open the link in a browser, then click on image and choose “open image in new guide”. Then copy that link and it will work.

Edit: sigh, not for drive only for regular web site.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 8, 2019, 3:06pm UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222/9 "2019-11-08T15:06:38Z")

</div>

I managed it with an image that I stored on Pinterest with the method I described previously.

```auto
PImage img; 

void setup() { 
  size(250, 200); 
  img = loadImage("https://i.pinimg.com/236x/d9/63/aa/d963aa82a6b11b236543d0a3a0842e50.jpg"); 
  image(img, 0, 0);
}

```

---

<div class="post-metadata">

**Author:** ![PhoenixStormJr](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@PhoenixStormJr](https://discourse.processing.org/u/PhoenixStormJr)\
**Post date:** [November 9, 2019, 10:55pm UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222/10 "2019-11-09T22:55:19Z")

</div>

Yay pininterest works! THANK you so much! I can save so much more space with this!

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 12, 2019, 10:18am UTC](https://discourse.processing.org/t/can-i-upload-an-image-to-the-web/15222/12 "2019-11-12T10:18:33Z")

</div>

Hi, mikeren, welcome to the community.
