This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public/components | |
| node_modules | |
| .idea |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn = function(req, res) { | |
| var dest, fileName, fs, l, tmpPath; | |
| fs = require('fs'); | |
| tmpPath = req.files.upload.path; | |
| l = tmpPath.split('/').length; | |
| fileName = tmpPath.split('/')[l - 1] + "_" + req.files.upload.name; | |
| dest = __dirname + "/public/uploads/" + fileName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user = "domain\\username" | |
| pass = "password" | |
| url = "http://sharepoint/siteCollection" | |
| list = "listName" | |
| request = require 'request' | |
| getListTypeByTitle = (title, cb)-> | |
| processRequest = (err, res, body)-> | |
| cb(err, JSON.parse(body).d.ListItemEntityTypeFullName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user = "domain\\username" | |
| pass = "password" | |
| url = "http://sharepoint/siteCollection" | |
| list = "listName" | |
| request = require 'request' | |
| getListContext = (title, cb)-> | |
| processRequest = (err, res, body)-> | |
| cb(err, JSON.parse(body).d.GetContextWebInformation.FormDigestValue) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user = "domain\\username" | |
| pass = "password" | |
| url = "http://sharepoint/siteCollection" | |
| list = "listName" | |
| # These two variables need to be obtained from the sharepoint server | |
| itemType = "SP.Data.SomethingListItem" | |
| context = "some really long hex string value" | |
| # Define the request fn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user = "domain\\username" | |
| pass = "password" | |
| url = "http://sharepoint/siteCollection" | |
| list = "listName" | |
| spItemId = 1 | |
| fileName = "filename.file" | |
| data = "" # The file data should be pulled from the fs using { encoding: null } | |
| # This is pulled from REST using ./_api/contextinfo | |
| context = "some really long hex string value" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table cellspacing="0" width="100%" class="ms-rteTable-default"> | |
| <tbody> | |
| <tr class="ms-rteTableEvenRow-default" style="background-color: #b70101;"> | |
| <td class="ms-rteTableEvenCol-default" style="width: 50%;"> | |
| <h1 style="color:white !important;">Description</h1> | |
| </td> | |
| <td class="ms-rteTableOddCol-default" style="width: 50%;"> | |
| <h1 style="color:white !important;">Contact</strong></h1> | |
| </td> | |
| </tr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="progress" id="progress" style="width:100%"> | |
| <div class="bar bar-success" style="width:100%"><p id=progressDisplay>0%</p></div> | |
| </div> | |
| <form enctype="multipart/form-data" action="/mUpload" method="post" id="fileForm"> | |
| <input type="file" id="fileField"> | |
| <a class="btn btn-small btn-primary" id="addFile">Upload File</a> | |
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| handler = ()-> | |
| document.getElementById("fileField").files | |
| # Make sure a file is selected first | |
| if files.length <= 0 | |
| alert('choose a file, first') | |
| return | |
| file = files[0] | |
| fd = new FormData() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mUpload = (req, res)-> | |
| file = req.files["fileForm"] | |
| tmpPath = file.path | |
| fileName = file.name | |
| dest = __dirname + "/#{fileName}" | |
| fs.readFile tmpPath, (err, data)-> | |
| fs.writeFile dest, data, (err)-> |