Skip to content

Commit

Permalink
use SID in path for record upload: cobweb-eu/pcapi#43
Browse files Browse the repository at this point in the history
  • Loading branch information
gmh04 committed Apr 26, 2016
1 parent 783a527 commit 9a6415b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/www/js/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ define(['records', 'map', 'utils', './ext/pcapi'], function(
* @param {Object} options upload options
*/
var uploadAsset = function(file, fileName, options){
var assetUrl = pcapi.buildUserUrl(userId, "records", record.name) + '/' + fileName;
var path = records.typeFromRecord(record) + "/" + record.name;
var assetUrl = pcapi.buildUserUrl(
userId,
"records",
path) + '/' + fileName;
console.debug("Asset url is "+assetUrl);

options.fileName = fileName;
Expand Down Expand Up @@ -232,12 +236,10 @@ define(['records', 'map', 'utils', './ext/pcapi'], function(
}, 1000);
};

//console.debug("Post: " + recordDir);

var save = pcapi.saveItem({
userId: userId,
remoteDir: "records",
path: record.name,
path: records.typeFromRecord(record) + "/" + record.name,
data: processedRecord
});

Expand Down

0 comments on commit 9a6415b

Please sign in to comment.