Fixed issues relating to file objects

Adding file through product action menu fixed. Fixed issue when directory is missing during file upload.