diff --git a/plugins/tiddlywiki/aws/docs/help.tid b/plugins/tiddlywiki/aws/docs/help.tid
index 4f26ef5ac..fb94b10f3 100644
--- a/plugins/tiddlywiki/aws/docs/help.tid
+++ b/plugins/tiddlywiki/aws/docs/help.tid
@@ -28,7 +28,7 @@ The content in the files is deserialized according to the content type reported
Save a raw tiddler to a file in an S3 bucket.
```
---aws s3-savetiddler
+--aws s3-savetiddler
```
* ''title'': title of the tiddler to save
@@ -36,19 +36,21 @@ Save a raw tiddler to a file in an S3 bucket.
* ''bucket'': name of the bucket to save the saved file
* ''filename'': filename of the saved file
* ''zipfilename'': optional; the file will be packed into a ZIP file with the specified name
+* ''savetype'': optional; the MIME type for the saved file (defaults to ''type'' or "text/html")
! "s3-savetiddlers" subcommand
Save raw tiddlers matching a filter to an S3 bucket.
```
---aws s3-savetiddlers
+--aws s3-savetiddlers
```
* ''filter'': filter identifying tiddlers to render
* ''region'': AWS region
* ''bucket'': name of the bucket to save the files
* ''prefix'': prefix for rendered file names
+* ''savetype'': optional; the MIME type for the saved file (defaults to ''type'' or "text/html")
! "s3-rendertiddler" subcommand
diff --git a/plugins/tiddlywiki/aws/modules/command.js b/plugins/tiddlywiki/aws/modules/command.js
index d7127999b..b1f61eb03 100644
--- a/plugins/tiddlywiki/aws/modules/command.js
+++ b/plugins/tiddlywiki/aws/modules/command.js
@@ -163,6 +163,7 @@ Command.prototype.subCommands["s3-savetiddler"] = function() {
bucket = this.params[3],
filename = this.params[4],
zipfilename = this.params[5],
+ saveType = this.params[6],
tiddler = wiki.getTiddler(title),
text = tiddler.fields.text,
type = tiddler.fields.type,
@@ -182,7 +183,7 @@ Command.prototype.subCommands["s3-savetiddler"] = function() {
}
// Save the file
async.series([
- awsUtils.putFile.bind(null,region,bucket,filename,text,type)
+ awsUtils.putFile.bind(null,region,bucket,filename,text,saveType || type)
],
function(err,results){
self.callback(err,results);
@@ -198,6 +199,7 @@ Command.prototype.subCommands["s3-savetiddlers"] = function() {
region = this.params[2],
bucket = this.params[3],
prefix = this.params[4],
+ saveType = this.params[5],
tiddlers = wiki.filterTiddlers(filter);
// Check parameters
if(!filter || !region || !bucket || !prefix) {
@@ -210,7 +212,7 @@ Command.prototype.subCommands["s3-savetiddlers"] = function() {
var tiddler = wiki.getTiddler(title),
text = tiddler.fields.text || "",
type = tiddler.fields.type || "text/vnd.tiddlywiki";
- awsUtils.putFile(region,bucket,prefix + encodeURIComponent(title),text,type,callback);
+ awsUtils.putFile(region,bucket,prefix + encodeURIComponent(title),text,saveType || type,callback);
},
function(err,results) {
self.callback(err,results);