Does Google App Engine support ftp?

后端 未结 4 638
鱼传尺愫
鱼传尺愫 2020-12-11 03:50

Now I use my own Java FTP program to ftp objects from my PC to my ISP\'s website server.

I want to use Google App Engine\'s servlet to get Paypal IPN messages, then

4条回答
  •  心在旅途
    2020-12-11 04:22

    UPDATE: Our code below may no longer work. This FTP code worked for us before but we see a comment now below that says FTP is no longer supported on App Engine. See the link below. If you try this code and it works or doesn't work for you for straight FTP (TLS is NOT supported BTW) - please comment.


    Yes. FTP now works on Google App Engine. (The accepted answer is outdated and no longer true.)

    Here is tested and working code on GAE.

    #!/usr/bin/env python
    from google.appengine.ext import webapp
    from ftplib import FTP
    
    class HwHandler(webapp.RequestHandler):
                     def get(self):
                       self.response.out.write('FTP Starting...
    ') ftp = FTP('ftp_site.com') ftp.login('login', 'password') ftp.retrlines('LIST') # list directory contents self.response.out.write('FTP opened') ftp.quit() app = webapp.WSGIApplication([ ('/', HwHandler) ], debug=True)

    Of note, FTP TLS does not appear to work currently. (Trying to do "from ftplib import FTP_TLS" fails.)

提交回复
热议问题