def deleteFile(fileId, filename): userId = RetrieveSessionDetails('userId') currentFolderId = RetrieveSessionDetails('currentFolderId') parentFolderId, parentfolderName = BusinessLayer.getParentFolderForFile( fileId, userId) print("kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk: ", parentFolderId) print("llllllllllllllllllllllllllllllllllllllllll: ", parentfolderName) flag = BusinessLayer.RemoveExisitngFile(userId, currentFolderId, fileId, filename) if flag == True: try: path = BusinessLayer.getPathForFolder(userId, parentFolderId) target = os.path.join(APP_STORAGE_PATH, path) destination = "/".join([target, filename]) os.remove(destination) AddToSession('TotalSize', BusinessLayer.getTotalSize(userId)) except OSError: pass return redirect(url_for('index', folderId=currentFolderId))
def deleteFile(fileId,filename): userId = RetrieveSessionDetails('userId') currentFolderId = RetrieveSessionDetails('currentFolderId') flag = BusinessLayer.RemoveExisitngFile(userId,currentFolderId,fileId,filename) AddToSession('TotalSize',BusinessLayer.getTotalSize(userId)) return redirect(url_for('index',folderId = currentFolderId))