mirror of https://github.com/Xhofe/alist
commit
3b413c2ee2
|
@ -7,13 +7,6 @@ package webdav
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/Xhofe/alist/conf"
|
|
||||||
"github.com/Xhofe/alist/drivers/base"
|
|
||||||
"github.com/Xhofe/alist/drivers/operate"
|
|
||||||
"github.com/Xhofe/alist/model"
|
|
||||||
"github.com/Xhofe/alist/server/common"
|
|
||||||
"github.com/Xhofe/alist/utils"
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"mime"
|
"mime"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -21,6 +14,14 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/Xhofe/alist/conf"
|
||||||
|
"github.com/Xhofe/alist/drivers/base"
|
||||||
|
"github.com/Xhofe/alist/drivers/operate"
|
||||||
|
"github.com/Xhofe/alist/model"
|
||||||
|
"github.com/Xhofe/alist/server/common"
|
||||||
|
"github.com/Xhofe/alist/utils"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
type FileSystem struct{}
|
type FileSystem struct{}
|
||||||
|
@ -203,6 +204,8 @@ func (fs *FileSystem) Upload(ctx context.Context, r *http.Request, rawPath strin
|
||||||
mimeTypeTmp := mime.TypeByExtension(path.Ext(fileName))
|
mimeTypeTmp := mime.TypeByExtension(path.Ext(fileName))
|
||||||
if mimeTypeTmp != "" {
|
if mimeTypeTmp != "" {
|
||||||
mimeType = mimeTypeTmp
|
mimeType = mimeTypeTmp
|
||||||
|
} else {
|
||||||
|
mimeType = "application/octet-stream"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fileData := model.FileStream{
|
fileData := model.FileStream{
|
||||||
|
|
Loading…
Reference in New Issue