mirror of
https://github.com/neocities/neocities.git
synced 2025-07-21 01:56:03 +02:00
finishing up drag-n-drop code, use param for filename with site_file/text_editor
This commit is contained in:
parent
943271b509
commit
f6af2cbbcf
7 changed files with 196 additions and 399 deletions
|
@ -102,12 +102,12 @@ post '/api/upload' do
|
|||
end
|
||||
|
||||
if current_site.too_many_files?(files.length)
|
||||
api_error 400, 'too_many_files', "cannot exceed the maximum site files limit (#{current_site.plan_feature(:maximum_site_files)}), #{current_site.supporter? ? 'please contact support' : 'please upgrade to a supporter account'}"
|
||||
api_error 400, 'too_many_files', "cannot exceed the maximum site files limit (#{current_site.plan_feature(:maximum_site_files)})"
|
||||
end
|
||||
|
||||
files.each do |file|
|
||||
if !current_site.okay_to_upload?(file)
|
||||
api_error 400, 'invalid_file_type', "#{file[:filename]} is not a valid file type (or contains not allowed content) for this site, please upgrade to a supporter account to upload this file type"
|
||||
api_error 400, 'invalid_file_type', "#{file[:filename]} is not a allowed file type for free sites, supporter required"
|
||||
end
|
||||
|
||||
if File.directory? file[:filename]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue