git clone https://github.com/TannerReynolds/ShareX-Upload-Server.git
cd ShareX-Upload-Server
chmod +x install.sh
./install.sh
docker build -t sharex-upload-server .
docker run --name "sharex-upload-server" -d \
-v $(pwd)/src/config.json:/usr/src/app/config.json \
-v $(pwd)/src/db.json:/usr/src/app/db.json \
-v $(pwd)/src/server/uploads/:/usr/src/app/server/uploads/ \
-p 8000:80 -p 8443:443 \
sharex-upload-server
docker logs -f sharex-upload-server
/src/config.json
will be the config file used if you used the above command to start the server. The web UI will be available on https://server-ip:8443
if https is enabled, and http://server-ip:8000
if it isn't.
In the files you downloaded from this repository, you will see a file called config.json
You must fill this out for the webserver to work properly. Below explains the configuration file and what each part does
{
"key": [""], // Password(s) for private uploading
"domain": "*.example.com", // Domain server will use. Will error if domain not used in request. Place "*" as the subdomain to enable wildcard subdomains for the webserver.
"puploadKeyGenLength": 64, // Amount of characters server should use for pupload files
"public": false, // Disables auth and does not render a password field for /upload
"maxUploadSize": 50, // max upload size for non-admins using regular key in MB
"markdown": true, // enables markdown rendering (upload whole .md file for render)
"port": 80, // port to listen on
"secure": true, // Whether or not you want https. (make sure key and cert.pem are in src directory)
"fileNameLength": 4, // File name length
"shortUrlLength": 3, // File name length for short URLs
"securePort": 443, // Port to use when secure is true
"ratelimit": 1000, // Ratelimit for POSTing in milliseconds
"dateURLPath": false, // Set to true to prefix uploads with the date (Ex: https://domain.com/2020/04/22/ghNa.pdf)
"allowed":[
"png", "jpg", "gif", "mp4", "mp3", "jpeg", "tiff", "bmp", "ico", "psd", "eps", "raw", "cr2", "nef", "sr2", "orf", "svg", "wav", "webm", "aac", "flac", "ogg", "wma", "m4a", "gifv"
], // Allowed file types for non-admins
"admin":{
"key": [""], // Admin password(s) for uploading & for gallery access
"maxUploadSize": 1024, // Max upload size for admin in MB
"allowed": [
"png", "jpg", "gif", "mp4", "mp3","jpeg", "tiff", "bmp", "ico", "psd", "eps", "raw", "cr2", "nef", "sr2", "orf", "svg", "wav", "webm", "aac", "flac", "ogg", "wma", "m4a", "gifv", "html"
] // Allowed file types for admins
},
"paste": {
"maxUploadSize": 20 // allowed paste upload size in MB
},
"discordToken": "", // Discord bot token
"discordAdminIDs": ["discord IDs of people who can run commands go here", "Like this"], // User IDs in an array
"discordChannelID": "", // Channel ID for monitoring uploads to
"prefix": "" // Bot Prefix
}
Once you've properly configured your server, you can run node index.js
in the src folder to start the server.You can keep your server running forever if you use a process manager, like pm2. pm2 installs along with your server if you used the install.sh script to install your server. Otherwise you can run npm i -g pm2
to install pm2. Then you can run your server by running pm2 start index.js
, and monitor logs and such using pm2 monit
If you're configuring this webserver to run through an Nginx reverse proxy, make sure you add these lines to your reverse proxy config
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
This is generally some things you want to add to your config, and is what's actually required for ShareS to work properly. This is because ShareS returns uploads like [http/https]://[requested url]/[filename]
and since you're running ShareS through a reverse proxy, unless you're passing along the original headers, ShareS is most likely just going to send you something like http://[server's real ip address]/[filename]
If you have multiple domains pointed to this webserver, only one (can include wildcard subdomain) can be used, unless the domain setting is set to just a single * like so: "domain": "*",
. This means that any domain will be accepted as a valid domain by the server, regardless of subdomain.
if you wish to log your webserver's activity in a Discord channel for whatever reason, you can.Here is information on how to setup a bot account and get the information needed for Discord logging
Destinations -> Custom Uploader Settings
Destination Location
pupload
, and then make the value whatever you want the password to beIn addition to being able to use any password you want for puploads, if you type in *random*
as your pupload field, the server will automatically generate a password for you. This password will include letters, numbers, and special characters. It will generate a key based on the length you specify in your config (puploadKeyGenLength). When making requests, the server will return the image URL with the key like so URL: https://qoilo.com/lhHr | KEY: Np$[CBk>X[c^YY{MDlCHH0|Qfm1uK0*lld^Mi$f4d62R5x6C2>~yaL}3*QYnziuZ
showCase
, and then make the value true
In order to use ShareS with Flameshot you will need to use a simple script, here is an example:
key="YourPassword"
# Only needed for multi-domain support, if you only have one simply set the url
# 2 lines below to url="https://your.domain/api/files"
urls=("https://example.com/api/files" "https://example.org/api/files")
url=${urls[$RANDOM % ${#urls[@]}]}
temp_file="/tmp/screenshot.png"
# Run flameshot --help for options
flameshot gui -r > $temp_file
# For some reason flameshot always seems to exit with 0 even when aborting the process
# so we had to find a way around that.
if [[ $(file --mime-type -b $temp_file) != "image/png" ]]; then
rm $temp_file
notify-send "Screenshot aborted" -a "Flameshot" && exit 1
fi
image_url=$(curl -X POST -F "fdata=@"$temp_file -F "key="$key -v "$url" 2>/dev/null)
echo -n $image_url | xclip -sel c
notify-send "Image URL copied to clipboard" "$image_url" -a "Flameshot" -i $temp_file
rm $temp_file
When running this script simply hit enter when you're satisfied with your image, Flameshot will then save the image to your clipboard which will then be replaced with the image URL once it's uploaded. For the best results I suggest disabling notifications in the Flameshot app.
4.5.6
, make sure to change the shield in the README and the package.json file to say version 4.5.7
. If the version is 4.5.10
, then update it to 4.5.11
. Only update the last digit. Updates/PRs that are not code (README.md, install.sh, sxcu files, package.json, etc.) should not constitute an updated version number for the project, so PRs for those specific files will not increment the version number自己实现的一个文件上传: <html> <form enctype="multipart/form-data" action="upload.php" method="POST"> Choose an image to upload: <br> <input name="uploaded" type="file"><br> <br> <input name="Uplo
[转] PHP File Upload 一,表单 1,上传文件的表单使用post方式(和get的区别不用说了);还要加上enctype='multipart/form-data'。 2,一般要加上隐藏域:<input type=hidden name='MAX_FILE_SIZE' value= dddddd>,位置在file域前面。value的值是上传文件的客户端字节限制。据说可
用httpclient upload上传文件时,代码如下: HttpPost httpPost = new HttpPost(uploadImg); httpPost.addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*
UploadServlet 的源代码 如下所示: package com.runoob.test; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.List; import javax.servlet.ServletException; import j
fileup2_in.jsp多文件同时上传 <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %> <%@ page import="org.apache.commons.fileupload.*" %> <%@ page import="java.ut
fileup_in.jsp //单文件上传 <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %> <%@ page import="org.apache.commons.fileupload.*" %> <%@ page import="java.u
我这用的是commons-fileupload-1.3.1.jar,commons-io-1.4.jar 可能有些人sfu.parseRequest(request),这个为空,这是为什么,是因为,在前端的表单中,file的name需要指定。 上传文件类型,大小,这些我都没判断了。 import java.io.File; import java.text.SimpleDateFormat; im
首先导入需要的 js和css <script type="text/javascript" src="../scripts/FileUploadField.js"></script> <link rel="stylesheet" type="text/css" href="../css/fileuploadfield.css"></link> 前边js页面代码 fp = new
ShareX 是开源的高级截图工具和屏幕记录器。使用 ShareX,只需要一个快捷键就可以保存截图到你的粘贴板,硬盘或者上传到 40 不同的文件存储服务上。ShareX 的插件还可以上传图片,文本文件和其他各种文件类型。
以下示例说明如何在使用Spring Web MVC框架的表单中使用文件上载控件。 首先,让我们使用一个可用的Eclipse IDE,并遵循以下步骤使用Spring Web Framework开发基于动态表单的Web应用程序。 步 描述 1 在Spring MVC - Hello World章节中解释,在com.wenjiangs包下创建一个名为HelloWeb的项目。 2 在com.wenjian
We’ve supported local file picking and image uploading for quite some time already. However making these features functional required some effort on the user’s side, while not being immediately obviou
一个支持多种语言的web文件上传组件
1、插件说明 在支持FormData的浏览器完全使用AJAX(即XMLHttpRequest)和input的files属性共同完成上传文件,否则就模拟表单提交来上传文件。支持写的文章和脚本现在看起来都比较稚嫩,现在重新整理、约束,更好的API和便捷使用方法。 插件名称:jquery-upload。 2、插件使用 // 1、判断浏览器支持特征 // 是否支持HTML5的input的files对象,用
Open Upload是一个可扩展的PHP开源项目用于创建一个私有/公共的文件下载服务器。主要特性包括:基于分组的访问控制权限,页面采用模板驱动,多数据库 支持(MySQL、Postgress等),多种用户登录验证方式(数据库,LDAP)支持。可以通过插件来扩展文件上传/下载限制功能(包括密码保护, 验证码,Email,IP限制)。