Is it possible, using swift, to verify data: Data is image using Foundation.framework only?
data: Data
Foundation.framework
Nothing else from macOS or iOS is available as this is for Server side project only (Vapor)
If all you have is the byte array, this might help: Determine MIME type from NSData?.
If you're uploading through multipart, you should have access to the filename (and possibly other data) that you could use to detect whether it's an image. Although this could be spoofed.
Client side validation might also be useful here.
If all you have is the byte array, this might help: Determine MIME type from NSData?.
If you're uploading through multipart, you should have access to the filename (and possibly other data) that you could use to detect whether it's an image. Although this could be spoofed.
Client side validation might also be useful here.