Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-rest-fs-openacs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-rest-fs-openacs
Commits
f7ace4ae
Commit
f7ace4ae
authored
Jan 10, 2019
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed folder and file deletion
- Fixed registering content-types in folders
parent
c63c3825
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
intranet-rest-fs-openacs-procs.tcl
tcl/intranet-rest-fs-openacs-procs.tcl
+2
-0
upload.tcl
www/upload.tcl
+13
-7
No files found.
tcl/intranet-rest-fs-openacs-procs.tcl
View file @
f7ace4ae
...
...
@@ -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
'"
...
...
www/upload.tcl
View file @
f7ace4ae
ad_page_contract
{
page to add a new file to the system
@author
Kevin Scaldeferri
(
kevin@arsdigita
.com
)
@creation-date 6 Nov 20
00
@author
Frank Bergmann
(
frank.bergmann@project-open
.com
)
@creation-date 6 Nov 20
18
@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
}
{
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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment