Old files are saved with full paths, this changes so that new files are not saved with absolute paths and detects old files saved and fixes them.

Этот коммит содержится в:
Christopher Speller
2015-07-21 16:15:24 -04:00
родитель bee26e3f26
Коммит f5837c1b64
2 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@@ -115,7 +115,7 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
fileUrl := c.GetSiteURL() + "/api/v1/files/get/" + channelId + "/" + c.Session.UserId + "/" + uid + "/" + url.QueryEscape(files[i].Filename)
fileUrl := "/" + channelId + "/" + c.Session.UserId + "/" + uid + "/" + url.QueryEscape(files[i].Filename)
resStruct.Filenames = append(resStruct.Filenames, fileUrl)
}