Main Page

From GalaDex
Jump to: navigation, search

Aa | Bb | Cc | Dd | Ee | Ff | Gg | Hh | Ii | Jj | Kk | Ll | Mm | Nn | Oo | Pp | Qq | Rr | Ss | Tt | Uu | Vv | Ww | Xx | Yy | Zz | 01 | 23 | 45 | 67 | 89 | INDEX


Anouncements

ftp://galadex.com

capup

import os from flask import Flask, request

app = Flask(__name__) app.config['UPLOAD_FOLDER'] = 'uploads/' app.config['ALLOWED_EXTENSIONS'] = set(['jpg', 'jpeg', 'gif']) def allowed_file(filename):

   return '.' in filename and \
          filename.rsplit('.', 1)[1] in app.config['ALLOWED_EXTENSIONS']

@app.route('/', methods=['POST']) def upload():

   if request.method == 'POST':
       file = request.files['file']
       if file and allowed_file(file.filename):
           filename = file.filename
           file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
   return 'ok'

if __name__ == '__main__':

   app.run(
       host="0.0.0.0",
       port=int("80"),
  1. debug=True
       debug=False
   )