Giter Site home page Giter Site logo

aliyun_oss_pic_upload's Introduction

aliyun_oss_pic_upload

这个项目是一个使用 Flask 框架构建的简单应用程序,可以上传文件到阿里云 OSS。

功能

  • 上传文件到阿里云 OSS
  • 生成新的文件名,确保月份和日期以两位数字显示
  • 显示上传进度
  • 返回上传成功后的文件 URL

本地安装

  1. 克隆项目到本地
  2. 创建虚拟环境并激活
  3. 安装依赖项:pip install -r requirements.txt

配置

  1. 在环境变量中设置以下值:
    • ACCESS_KEY_ID:阿里云 OSS 的 Access Key ID
    • ACCESS_KEY_SECRET:阿里云 OSS 的 Access Key Secret
    • ENDPOINT:阿里云 OSS 的 Endpoint
    • BUCKET_NAME:阿里云 OSS 的 Bucket 名称

运行

  1. 在项目根目录下,运行 python index.pyflask run 启动应用程序。
  2. 打开浏览器,访问 http://localhost:5000/upload 上传文件。

部署到 Vercel

  1. 准备项目:确保 Flask 应用可运行,创建 requirements.txtvercel.json 配置文件。
  2. 在 Vercel 上创建项目并使用 GitHub、GitLab 或 Bitbucket 账户登录。
  3. 导入项目仓库,并配置项目选项,如环境变量。
  4. 部署项目:点击“Deploy”按钮,Vercel 将自动构建并部署您的 Flask 应用。
  5. 验证部署:访问 Vercel 提供的公开 URL,验证 Flask 应用是否正常运行。

aliyun_oss_pic_upload's People

Contributors

masterke2003 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.