Error While Creating a Folder

Hi Everyone,

I am trying to create a folder with the following code:#
JS Code

frappe.ui.form.on("Item", "create_folder", function(doclist) 
var data =  {
		"file_name": "Test_Folder",
		"folder": doclist.current_folder
    		method: "library_management.item_script.createe_folder",
    		args: data,
    		callback:function(r){  msgprint(r.message); }


Python Code

# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt

from __future__ import unicode_literals
record of files

naming for same name files: file.gif, file-1.gif, file-2.gif etc

import frappe, frappe.utils
from frappe.utils.file_manager import delete_file_data_content, get_content_hash, get_random_filename
from frappe import _

from frappe.utils.nestedset import NestedSet
from frappe.utils import strip
import json
import urllib
from PIL import Image, ImageOps
import os
import requests
import requests.exceptions
import StringIO
import mimetypes, imghdr
from frappe.utils import get_files_path

def createe_folder(file_name):
	""" create new folder under current parent folder """
	file = frappe.new_doc("File")
	file.file_name = file_name
	file.is_folder = 1
	file.folder = folder
return "Folder Created"

But I am getting the below error:

Traceback (innermost last):
File “/home/sam/frappe-bench/apps/frappe/frappe/”, line 57, in application
response = frappe.handler.handle()
File “/home/sam/frappe-bench/apps/frappe/frappe/”, line 19, in handle
File “/home/sam/frappe-bench/apps/frappe/frappe/”, line 36, in execute_cmd
ret =, **frappe.form_dict)
File “/home/sam/frappe-bench/apps/frappe/frappe/”, line 803, in call
return fn(*args, **newargs)
TypeError: runserverobj() takes at least 1 argument (1 given)

Does, anybody have any idea about it?

Ruchin Sharma

Were you trying to create a new file in the file manager module?

Please refer the below link
Modify move_file function