You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
β λ¬Έμ μν©
No response
π ν΅μ¬ λ΄μ©κ³Ό λ°©ν₯μ±
File vs. MultipartFile
1.
Filejava.io.Fileν΄λμ€2.
MultipartFileMultipartResolverλ₯Ό ν΅ν΄ μ²λ¦¬λ νμΌλ‘, μ£Όλ‘ νμΌ μ λ‘λ μμ²μ μ²λ¦¬ν λ μ¬μ©getInputStream(),getBytes(),transferTo(File dest)λ±μ λ©μλλ₯Ό μ¬μ©νμ¬ νμΌμ λ€λ£° μ μμμ λ‘λ κ³Όμ μμμ μ°¨μ΄μ
MultipartFile: HTTP μμ²μ ν΅ν΄ μ λ¬λ νμΌ. μμ§ νμΌ μμ€ν μ μ μ₯λμ§ μμ μνμΌ μ μμ.File:MultipartFileλ‘ μ λ¬λ νμΌμ μλ²μ νΉμ κ²½λ‘μ μ μ₯ν ν, κ·ΈλλΆν°Fileκ°μ²΄λ‘ λ€λ£° μ μμ.@RequestBody vs. @ModelAttribute
1.
@RequestBodyPOST,PUT,PATCHμμ μ¬μ©.μμ:
{ "name": "νκΈΈλ", "age": 25 }2.
@ModelAttributemultipart/form-dataλ°©μλ μ§μνλ―λ‘ νμΌ μ λ‘λκ° κ°λ₯.GET,POST,PUT,PATCHλ± λͺ¨λ μ¬μ©.MultipartFileκ³Ό ν¨κ» μ¬μ©ν μ μμ.μμ:
@RequestParam: νμΌ λ¨λ μ λ‘λ μ μ¬μ©.@ModelAttribute: νμΌ + λ€λ₯Έ νΌ λ°μ΄ν° ν¨κ» μ λ‘λ μ μ¬μ©.MultipartFileμ μ£Όμ λ©μλ
getOriginalFilename(): μλ³Έ νμΌλͺ κ°μ Έμ€κΈ°getSize(): νμΌ ν¬κΈ°getContentType(): MIME νμisEmpty(): λΉμ΄ μλμ§ νμΈgetBytes(): λ°μ΄νΈ λ°°μ΄λ‘ νμΌ λ΄μ© κ°μ Έμ€κΈ°getInputStream(): νμΌ λ΄μ©μ μ€νΈλ¦ΌμΌλ‘ μ½κΈ°transferTo(): νμΌμ μ§μ κ²½λ‘μ μ μ₯1. Amazon S3
νΉμ§
μ₯μ
λ¨μ
2. μΈλΆ μλ²(μ체 κ΅¬μΆ μλ²)
νΉμ§
μ₯μ
λ¨μ
3. FTP(File Transfer Protocol)
νΉμ§
μ₯μ
λ¨μ
π νΈλ¬λΈμν λ° κΈ°λν¨κ³Ό
No response
π κ΄λ ¨ μλ£
No response
πβ λ΄λΉμ
Beta Was this translation helpful? Give feedback.
All reactions