"weed upload" return message changes
This commit is contained in:
@@ -79,6 +79,8 @@ func upload(filename string, server string, fid string) (int, error) {
|
||||
}
|
||||
|
||||
type SubmitResult struct {
|
||||
FileName string `json:"fileName"`
|
||||
FileUrl string `json:"fileUrl"`
|
||||
Fid string `json:"fid"`
|
||||
Size int `json:"size"`
|
||||
Error string `json:"error"`
|
||||
@@ -101,13 +103,14 @@ func submit(files []string) []SubmitResult {
|
||||
fid = ""
|
||||
results[index].Error = err.Error()
|
||||
}
|
||||
results[index].FileName = file
|
||||
results[index].Fid = fid
|
||||
results[index].FileUrl = ret.PublicUrl + "/" + fid
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
func runUpload(cmd *Command, args []string) bool {
|
||||
*IsDebug = true
|
||||
if len(cmdUpload.Flag.Args()) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -213,6 +213,6 @@ func writeJsonQuiet(w http.ResponseWriter, r *http.Request, obj interface{}) {
|
||||
|
||||
func debug(params ...interface{}) {
|
||||
if *IsDebug {
|
||||
fmt.Println(params)
|
||||
log.Println(params)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user