#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    5
    Rep Power
    0

    File upload - ajax


    There's a python file upload script in the course HTML 5 Power by Andy Olsen.

    The problem is that the upload doesn't occurs (file not transfered).

    Please see there :
    stackoverflow.com/questions/18984923/upload-file-with-python-where-is-the-file

    It's unresolved.

    What is exactly missing in the python so that the file upload occurs ?


    Thanks,

    Patrick
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,996
    Rep Power
    481
    Is your goal to fix the python program or do you actually just need the file?

    wget url
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    5
    Rep Power
    0
    I want the python script to be fixed so that the file be transferred to the server.
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,996
    Rep Power
    481
    Just use freakin' ftp.
    [code]Code tags[/code] are essential for python code and Makefiles!
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    5
    Rep Power
    0
    ftp? Is this a joke ?

    I want to know how to use python to upload the file.
    If someone know python here, please see my stackoverflow link, and tell me what's missing in the python script for the file to be uploaded.

    Thanks
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    876
    Rep Power
    276
    The way I am understanding that lesson, that python "server" is all running in memory, so, no actual harddrive usage is being done.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    5
    Rep Power
    0
    Ok.
    Does it mean that it is not possible to upload the file this way?
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    876
    Rep Power
    276
    Originally Posted by trogne30
    Ok.
    Does it mean that it is not possible to upload the file this way?
    No, it just means that the lesson you watched was only discussing the capabilities of the "Communication API of AJAX v2 and websocket" with the ability to use different domains (which is something that normal AJAX/javascript doesn't allow you to do).

    If you want to get it to work in an "actual" server environment, you will need to rewrite that python server script to incorporate using the HDD to save the files to, just as some on StackOverflow told you...or, use another server environment that supports websocket and go from there.

    I don't know python programming, so, I wouldn't be able to tell you what you need to add/change in the CORSServer.py file to make it work the way you want, but, I understood enough about the lesson and in researching the python imports, to know that "Andy" was doing all of that "in RAM memory" because he never showed you where the file was saved to.

    Good luck to you.


    And anyone else that reads this, please correct me on any of my points , if I am mistaken.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    5
    Rep Power
    0
    Thank you for this explanation!

IMN logo majestic logo threadwatch logo seochat tools logo