# Networking with URLSession · Uploading Data | raywenderlich.com

**URL:** <https://forums.kodeco.com/t/networking-with-urlsession-uploading-data-raywenderlich-com/52495>\
**Category:** 🎓 Courses & Articles\
**Created:** [October 10, 2018, 7:19pm UTC](https://forums.kodeco.com/t/networking-with-urlsession-uploading-data-raywenderlich-com/52495 "2018-10-10T19:19:57Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![george30](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/george30/32/81494_2.png) [@george30](https://forums.kodeco.com/u/george30)\
**Post date:** [September 8, 2020, 4:45pm UTC](https://forums.kodeco.com/t/networking-with-urlsession-uploading-data-raywenderlich-com/52495/22 "2020-09-08T16:45:34Z")

</div>

Hi Brian,

Where should I paste the content of upload.py?

I follow your steps in the video I have everything on my desktop, but still I could not upload this file.

**from** flask **import** Flask, request

**import** sys

app = Flask( **name** )

@app.route(“/”)

**def** hello():

**return** “Hello!”

@app.route(‘/upload’, methods = [‘GET’, ‘POST’])

**def** saveImage():

print(request.get\_data(), file=sys.stderr)

imfile = request.get\_data()

**with** open(‘image.jpg’,‘wb’) **as** f:

f.write(imfile)

**return** “Uploaded”

This is what the file contains, but I still didn’t understand why is not uploading, been on this for a while and still I haven’t figured this out

---

<div class="post-metadata">

**Author:** ![george30](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/george30/32/81494_2.png) [@george30](https://forums.kodeco.com/u/george30)\
**Post date:** [September 8, 2020, 5:29pm UTC](https://forums.kodeco.com/t/networking-with-urlsession-uploading-data-raywenderlich-com/52495/24 "2020-09-08T17:29:49Z")

</div>

Hi Brian,

The issue was that I didn’t install python in the right terminal window, I opened a new terminal tab for my desktop and now I was able to import the file(at least I learned this one as well) thanks for coming back to me anyway.

---

<div class="post-metadata">

**Author:** ![bdmoakley](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bdmoakley/32/108772_2.png) [@bdmoakley](https://forums.kodeco.com/u/bdmoakley)\
**Post date:** [September 8, 2020, 6:13pm UTC](https://forums.kodeco.com/t/networking-with-urlsession-uploading-data-raywenderlich-com/52495/25 "2020-09-08T18:13:30Z")

</div>

I’m glad to hear that you worked through it. In the updated course, I actually decided to drop the Python component since it caused too many headaches. Now, I use a vapor server instead (which is written in Swift).

In any case, nice work!

---

<div class="post-metadata">

**Author:** ![george30](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/george30/32/81494_2.png) [@george30](https://forums.kodeco.com/u/george30)\
**Post date:** [September 8, 2020, 8:54pm UTC](https://forums.kodeco.com/t/networking-with-urlsession-uploading-data-raywenderlich-com/52495/26 "2020-09-08T20:54:26Z")

</div>

Was a bit, but that’s a beauty of programming , and for me as a beginner is definitely is an achievement.Thank you! I started with UIKit and that’s why I wanted to follow this course SwiftUI is new but I will pick that up after I know how to properly work with UIKit, lot of companies are work with UIKit which will be around long time. The course is good, but each one of us beginners pick things up differently I guess.

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [April 8, 2021, 5:06am UTC](https://forums.kodeco.com/t/networking-with-urlsession-uploading-data-raywenderlich-com/52495/27 "2021-04-08T05:06:24Z")

</div>

@george30 Do you still have issues with this?

[Previous page](https://forums.kodeco.com/t/networking-with-urlsession-uploading-data-raywenderlich-com/52495.md?page=1)
