fixing bug with directory save
resolve conflict
Mimetype detection improved