text: import os
  
  from flask import flash, request, redirect, render_template
  from werkzeug.utils import secure_filename
  
  from TranscriptService import app
  
  app.secret_key = "secret key"
  app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024
  
  path = os.getcwd()
  # file Upload
  UPLOAD_FOLDER = os.path.join(path, 'uploads')
  
  if not os.path.isdir(UPLOAD_FOLDER):
      os.mkdir(UPLOAD_FOLDER)
  
  app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
  
  ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'}
  
  
  def allowed_file(filename):
      return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
  
  
  @app.route('/')
  def upload_form():
      return render_template('upload.html')
  
  
  @app.route('/', methods=['POST'])
  def upload_file():
      if request.method == 'POST':
          # check if the post request has the file part
          if 'file' not in request.files:
              flash('No file part')
              return redirect(request.url)
          file = request.files['file']
          if file.filename == '':
              flash('No file selected for uploading')
              return redirect(request.url)
          if file and allowed_file(file.filename):
              filename = secure_filename(file.filename)
              file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
              flash('File successfully uploaded')
              return redirect('/')
          else:
              flash('Allowed file types are txt, pdf, png, jpg, jpeg, gif')
              return redirect(request.url)
  