mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-12-24 03:10:19 +01:00
fixes
This commit is contained in:
parent
2d5c256642
commit
5310566b81
2 changed files with 9 additions and 8 deletions
|
@ -390,6 +390,8 @@ func (s *Server) putHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
reader = r.Body
|
||||
|
||||
defer r.Body.Close()
|
||||
|
||||
if contentLength == -1 {
|
||||
// queue file to disk, because s3 needs content length
|
||||
var err error
|
||||
|
|
|
@ -402,11 +402,11 @@ func (s *GDrive) findId(filename string, token string) (string, error) {
|
|||
|
||||
q := fmt.Sprintf("'%s' in parents and name='%s' and mimeType='%s' and trashed=false", s.rootId, token, GDriveDirectoryMimeType)
|
||||
l, err := s.list(nextPageToken, q)
|
||||
for 0 < len(l.Files) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
for 0 < len(l.Files) {
|
||||
for _, fi := range l.Files {
|
||||
tokenId = fi.Id
|
||||
break
|
||||
|
@ -427,12 +427,11 @@ func (s *GDrive) findId(filename string, token string) (string, error) {
|
|||
|
||||
q = fmt.Sprintf("'%s' in parents and name='%s' and mimeType!='%s' and trashed=false", tokenId, filename, GDriveDirectoryMimeType)
|
||||
l, err = s.list(nextPageToken, q)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
for 0 < len(l.Files) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
for _, fi := range l.Files {
|
||||
|
||||
fileId = fi.Id
|
||||
|
|
Loading…
Reference in a new issue