• 欢迎访问db1024网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏db1024吧

Flask+WebUploader实现快速将本地文件上传到VPS服务器

建站知识 Liam 1年前 (2019-05-02) 690次浏览 18个评论 扫描二维码
文章目录[隐藏]

说明:之前博主就写过一篇将本地文件上传至VPS服务器的教程→点击查看,虽然该教程使用的jQuery-File-Upload很强大,但配置起来还是有点麻烦,现在再分享一个上传工具,使用Flask+WebUploader实现上传功能,使用起来很简单,但是不如jQuery-File-Upload稳定,不过各有所需,用来上传小文件是足矣的。

截图

Flask+WebUploader实现快速将本地文件上传到VPS服务器

安装

Github地址:https://github.com/abbeyokgo/flask_multi_uploader

1、安装依赖

#CentOS 6.x 32位 rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm yum install -y python-pip git  #CentOS 6.x 64位 rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum install -y python-pip git  #CentOS 7.x yum install -y epel-release yum install -y python-pip git #如果CentOS 7安装出现No package python-pip available,可以用以下命令进行安装 wget https://bootstrap.pypa.io/get-pip.py python get-pip.py  #Debian/Ubuntu系统 apt-get -y update apt-get -y install python-pip git 

2、运行程序

git clone https://github.com/abbeyokgo/flask_multi_uploader.git cd flask_multi_uploader #安装依赖 pip install -r requirements.txt #启动程序,8888端口可自行修改 gunicorn -k eventlet -b 0:8888 server:app 

如果启动的时候提示-bash: gunicorn: command not found错误,需要先运行命令:

pip install gunicorn 

然后再使用命令启动程序,接下来就可以访问IP:8888上传文件了,上传文件保存在upload文件夹。如果Web界面打不开,可能需要开启防火墙端口。

#CentOS 6 iptables -I INPUT -p tcp --dport 8888 -j ACCEPT service iptables save service iptables restart  #CentOS 7 firewall-cmd --zone=public --add-port=8888/tcp --permanent firewall-cmd --reload

开启端口后你会发现,启动命令运行出错了,这时候使用Ctrl+C断开命令,再重新使用命令启动即可。

如果你需要常驻后台,就得使用screen命令了,使用查看→传送门


db1024 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Flask+WebUploader实现快速将本地文件上传到VPS服务器
喜欢 (4)
关于作者:
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(18)个小伙伴在吐槽
  1. This is really interesting, You are a very skilled blogger. I've joined your feed and look forward to seeking more of your magnificent post. Also, I've shared your website in my social networks!
    web hosting services2020-09-05 18:06 回复 Linux | Firefox浏览器 60.0.2
  2. It's enormous that you are getting thoughts from this post as well as from our discussion made at this time.
    website hosting companies2020-09-01 00:14 回复 Linux | Firefox浏览器 60.0
  3. Superb post however , I was wondering if you could write a litte more on this topic? I'd be very grateful if you could elaborate a little bit further. Bless you!
    content hosting2020-08-31 20:32 回复 Linux | Firefox浏览器 60.0.2
  4. I am regular visitor, how are you everybody? This piece of writing posted at this web page is in fact pleasant.
    black mass2020-08-31 07:22 回复 Mac OS X | Firefox浏览器 61.0
  5. You have made some really good points there. I looked on the web to learn more about the issue and found most individuals will go along with your views on this web site. cheap flights 31muvXS
    cheap flights2020-08-26 11:00 回复 Linux | Firefox浏览器 59.0
  6. Woah! I'm really loving the template/theme of this site. It's simple, yet effective. A lot of times it's tough to get that "perfect balance" between usability and appearance. I must say that you've done a very good job with this. In addition, the blog loads extremely fast for me on Chrome. Outstanding Blog!
    cheap flights2020-08-24 08:33 回复 Windows 7 | Internet Explorer 10.0
  7. Have you ever thought about including a little bit more than just your articles? I mean, what you say is important and everything. Nevertheless think of if you added some great graphics or videos to give your posts more, "pop"! Your content is excellent but with pics and video clips, this site could undeniably be one of the best in its niche. Very good blog!
    best web hosting sites2020-08-14 16:54 回复 Mac OS X | Chrome 52.0.2777.85
  8. I know this if off topic but I'm looking into starting my own weblog and was curious what all is needed to get set up? I'm assuming having a blog like yours would cost a pretty penny? I'm not very internet savvy so I'm not 100% positive. Any suggestions or advice would be greatly appreciated. Kudos
    southwest airlines cheap flights2020-07-31 08:33 回复 Linux | Chrome 66.0.3359.139
  9. I was wondering if you ever thought of changing the layout of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or 2 images. Maybe you could space it out better? adreamoftrains website hosting services
    adreamoftrains web hosting service2020-07-30 20:21 回复 Windows 7 | Internet Explorer 10.0
  10. Yesterday, while I was at work, my cousin stole my apple ipad and tested to see if it can survive a twenty five foot drop, just so she can be a youtube sensation. My apple ipad is now broken and she has 83 views. I know this is completely off topic but I had to share it with someone!
    cheap flights with jet2 sale flights2020-07-28 09:29 回复 Linux | Chrome 68.0.3398.0
  11. Hello to every one, the contents present at this web site are genuinely awesome for people experience, well, keep up the nice work fellows.
    cheap flights to orlando florida2020-07-27 18:43 回复 Windows 7 | Opera 9.80
  12. We are a group of volunteers and starting a new scheme in our community. Your site offered us with valuable info to work on. You have done a formidable job and our whole community will be grateful to you.
    website hosting companies2020-07-27 07:03 回复 Linux | Chrome 66.0.3359.106
  13. What's up all, here every one is sharing these know-how, therefore it's fastidious to read this blog, and I used to pay a visit this website all the time.
    best web hosting company2020-07-25 09:18 回复 Windows 7 | Internet Explorer 9.0
  14. It is appropriate time to make some plans for the longer term and it is time to be happy. I've learn this publish and if I may just I desire to counsel you some attention-grabbing things or suggestions. Maybe you can write next articles referring to this article. I want to read more things about it!
    web hosting service2020-07-23 10:03 回复 Windows 8.1 | Chrome 67.0.3396.87
  15. Superb blog! Do you have any suggestions for aspiring writers? I'm hoping to start my own site soon but I'm a little lost on everything. Would you advise starting with a free platform like Wordpress or go for a paid option? There are so many choices out there that I'm totally confused .. Any recommendations? Appreciate it!
    website hosting companies2020-07-16 18:37 回复 Linux | Chrome 68.0.3398.0
  16. Hurrah! After all I got a webpage from where I know how to in fact take helpful facts concerning my study and knowledge.
    cbd oil that works 20202020-06-28 06:51 回复 Linux | Chrome 65.0.3325.93
  17. No matter if some one searches for his vital thing, so he/she wants to be available that in detail, therefore that thing is maintained over here.
    cbd oil that works 20202020-06-27 21:07 回复 Linux | Firefox浏览器 51.0
  18. certainly like your website but you have to test the spelling on quite a few of your posts. A number of them are rife with spelling issues and I in finding it very bothersome to tell the reality nevertheless I will certainly come again again.
    g rsacwgxy2020-06-22 14:37 回复 Linux | Chrome 65.0.3325.93