티스토리 뷰

Alamofire을 이용해서 이미지를 서버에 업로드 하는데, 다음과 같은 경고가 뜨면서 이미지 업로드가 안되는 문제가 발생했다. 

 

 

"no such file"....!!!!

분명히 사진 url을 받아와서 그대로 넘겨줬는데 왜 안될까???

 

스택오버플로우를 찾아보니 다음과 같은 이야기가 있었다. 

 

 

Container locations change periodically therefore never save full paths pointing to the application container to UserDefaults. Save only the file names and get the URL to the current document directory always with 

 

let documentsFolderURL = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false)

Then append the file name with .appendingPathComponent

 

=> Container locations change periodically, 즉 불러올때마다 이미지 location이 바뀐다는 것 !!!!

 

 

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함