Login middleware. File uploading.