Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fairblue
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hosting
chat
fairblue
Commits
1493470b
Commit
1493470b
authored
6 years ago
by
Ghazi Triki
Browse files
Options
Downloads
Patches
Plain Diff
Add `filename` attribute for file pre-upload using an URL
parent
9eae47dc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy
+17
-7
17 additions, 7 deletions
...rs/org/bigbluebutton/web/controllers/ApiController.groovy
with
17 additions
and
7 deletions
bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy
+
17
−
7
View file @
1493470b
...
...
@@ -1838,8 +1838,7 @@ class ApiController {
requestBody
=
StringUtils
.
isEmpty
(
requestBody
)
?
null
:
requestBody
;
if
(
requestBody
==
null
)
{
downloadAndProcessDocument
(
presentationService
.
defaultUploadedPresentation
,
conf
.
getInternalId
(),
true
/* default presentation */
);
downloadAndProcessDocument
(
presentationService
.
defaultUploadedPresentation
,
conf
.
getInternalId
(),
true
/* default presentation */
,
''
);
}
else
{
log
.
debug
"Request body: \n"
+
requestBody
;
def
xml
=
new
XmlSlurper
().
parseText
(
requestBody
);
...
...
@@ -1850,7 +1849,12 @@ class ApiController {
// need to iterate over presentation files and process them
module
.
children
().
each
{
document
->
if
(!
StringUtils
.
isEmpty
(
document
.
@url.toString
()))
{
downloadAndProcessDocument
(
document
.
@url.toString
(),
conf
.
getInternalId
(),
true
/* default presentation */
);
def
fileName
;
if
(!
StringUtils
.
isEmpty
(
document
.
@filename.toString
()))
{
log
.
debug
(
"user provided filename: [${module.@filename}]"
);
fileName
=
document
.
@filename.toString
();
}
downloadAndProcessDocument
(
document
.
@url.toString
(),
conf
.
getInternalId
(),
true
/* default presentation */
,
fileName
);
}
else
if
(!
StringUtils
.
isEmpty
(
document
.
@name.toString
()))
{
def
b64
=
new
Base64
()
def
decodedBytes
=
b64
.
decode
(
document
.
text
().
getBytes
())
...
...
@@ -1884,9 +1888,15 @@ class ApiController {
}
def
downloadAndProcessDocument
(
address
,
meetingId
,
current
)
{
log
.
debug
(
"ApiController#downloadAndProcessDocument(${address}, ${meetingId})"
);
String
presFilename
=
address
.
tokenize
(
"/"
)[-
1
];
def
downloadAndProcessDocument
(
address
,
meetingId
,
current
,
fileName
)
{
log
.
debug
(
"ApiController#downloadAndProcessDocument(${address}, ${meetingId}, ${fileName})"
);
String
presFilename
;
if
(
StringUtils
.
isEmpty
(
fileName
))
{
presFilename
=
address
.
tokenize
(
"/"
)[-
1
];
}
else
{
presFilename
=
fileName
;
}
def
filenameExt
=
FilenameUtils
.
getExtension
(
presFilename
);
String
presentationDir
=
presentationService
.
getPresentationDir
()
...
...
@@ -1900,7 +1910,7 @@ class ApiController {
def
pres
=
new
File
(
newFilePath
)
processUploadedFile
(
meetingId
,
presId
,
presFilename
,
pres
,
current
);
}
else
{
log
.
error
(
"Failed to download presentation=[${address}], meeting=[${meetingId}]"
)
log
.
error
(
"Failed to download presentation=[${address}], meeting=[${meetingId}]
, fileName=[${fileName}]
"
)
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment