Solution: initialize to -1, since fd is a file descriptor (int).
Attach a file by drag & drop or click to upload