Commit f7ace4ae authored by Frank Bergmann's avatar Frank Bergmann

- Fixed folder and file deletion

- Fixed registering content-types in folders
parent c63c3825
......@@ -26,6 +26,8 @@ ad_proc -public im_rest_fs_folder_for_path {
ns_log Notice "im_rest_fs_folder_for_path: object_id=$object_id, path=$path"
set folder_id [im_rest_fs_folder_for_object -object_id $object_id]
ns_log Notice "im_rest_fs_folder_for_path: object_id=$object_id, object_folder_id=$folder_id"
set path_pieces [split $path "/"]
foreach piece $path_pieces {
ns_log Notice "im_rest_fs_folder_for_path: folder_id=$folder_id: searching for '$piece'"
......
ad_page_contract {
page to add a new file to the system
@author Kevin Scaldeferri (kevin@arsdigita.com)
@creation-date 6 Nov 2000
@author Frank Bergmann (frank.bergmann@project-open.com)
@creation-date 6 Nov 2018
@cvs-id $Id$
} {
project_id:integer
......@@ -22,14 +22,20 @@ ns_log Notice "upload: project_id=$project_id, path=$path, upload_file=$upload_f
set ttt {
set max_bytes [parameter::get -parameter "MaximumFileSize"]
if {$n_bytes > $max_bytes } {
ad_return_complaint 1 "Your file is larger than the maximum file size allowed on this system ([util_commify_number $max_bytes] bytes)"
ad_script_abort
}
set max_bytes [parameter::get -parameter "MaximumFileSize"]
if {$n_bytes > $max_bytes } {
ad_return_complaint 1 "Your file is larger than the maximum file size allowed on this system ([util_commify_number $max_bytes] bytes)"
ad_script_abort
}
}
set folder_id [im_rest_fs_folder_for_path -object_id $project_id -path $path]
if {"" eq $folder_id} {
# Folder path not found
doc_return 400 "application/json" "{'success': false, 'message': 'Did not find folder ´[ns_quotehtml $path]´', 'data': {}}"
ad_script_abort
}
set mime_type [cr_filename_to_mime_type -create -- $upload_file]
set file_id [db_nextval "acs_object_id_seq"]
ns_log Notice "upload: folder_id=$folder_id, file_id=$file_id, mime_type=$mime_type"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment