mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-01-01 17:19:34 -06:00
[server][api] Fix upload response
This commit is contained in:
@@ -76,7 +76,7 @@ func handleUploadRequest(c *gin.Context) {
|
||||
}
|
||||
|
||||
// id may have changed if this is an overwrite
|
||||
r, err := f.ResourceByPath(params.Path)
|
||||
r, err := f.ResourceByPathWithRoot(params.Path)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ func (l localStorage) OpenWrite(name string) (io.WriteCloser, error) {
|
||||
return nil, err
|
||||
}
|
||||
return &callbackWriteCloser{dest: f, closeCallback: func(err error) error {
|
||||
defer os.Remove(f.Name())
|
||||
if err != nil {
|
||||
os.Remove(f.Name())
|
||||
return err
|
||||
}
|
||||
return os.Rename(f.Name(), l.path(name))
|
||||
|
||||
Reference in New Issue
Block a user