1. For PDF to file conversion and visa versa
https://tinywow.com/
2. For passport photo online
https://www.123passportphoto.com/
Some valuable information on SharePoint 2010,2013
1. For PDF to file conversion and visa versa
https://tinywow.com/
2. For passport photo online
https://www.123passportphoto.com/
if (document.getElementById("fileUpload").value != "") {
var fileControl = $('#fileUpload').get(0);
var fileData = fileControl.files;
var fileName = fileData[0].name;
var data = fileData[0];
var s = "";
if (data) {
var reader = new FileReader();
reader.readAsArrayBuffer(data);
reader.onload = function (evt) {
callingUpload(evt.target.result, fileName);
}
reader.onerror = function (evt) {
alert(evt.target.result);
}
}
}
=========================================
function callingUpload(buffer, fileName) {
////debugger;
var ActionID = "";
//debugger;
if (!isEmpty(GetParameterValues("ActionID")) && isEmpty(GetParameterValues("CopyAction")))
ActionID = GetParameterValues("ActionID");
else if (!isEmpty($('#hdnActionID').val()))
ActionID = $('#hdnActionID').val();
var itemIdenObj = {};
itemIdenObj.fileContent = btoa(arrayBufferToString(buffer));
itemIdenObj.fileName = fileName;
var selectedData = { 'fileContent': btoa(arrayBufferToString(buffer)).toString(), 'fileName': fileName.toString(), 'ActionID': ActionID }
$.LoadingOverlay('show');
//debugger;
$.ajax
({
type: "POST", contentType: "application/json; charset=utf-8", url: "NewActionForm.aspx/UploadDocument",
data: JSON.stringify(selectedData),
dataType: "json", async: true, success: function (result) {
if (result) {
//debugger;
var data = $.parseJSON(result.d);
$('#fileUpload').val('');
$("#filetable").empty();
for (var i = 0; i < data.length; i++) {
var item = data[i];
$('#hdnActionID').val(item.ID);
var rowId = $("#filetable > tbody > tr").length;
var serial_no = rowId + 1;
var delbtnId = 'delete_' + result + '_' + rowId;
//alert('File Uploaded successfully!');
//$('#filetable').append('<tr><td>' + serial_no + '</td><td><a href="' + fileUrl + '">' + fileName + '</a></td><td><input type="button" class="btn btn-danger filedelete" value="Delete" id="' + delbtnId + '" onclick="DeleteDocument(\'' + fileName + '\')"/></td></tr>');
$('#filetable').append('<tr><td><a href="' + item.FilePath + '" target="blank" class="text text-primary">' + item.FileName + '</a></td><td><input type="button" class="btn btn-danger filedelete" value="x" title="Delete" id="' + delbtnId + '" onclick="DeleteDocument(\'' + item.FileName + '\')"/></td></tr>');
}
$('#divFile').css("display", "block");
$.LoadingOverlay('hide');
}
}, error: function (result) {
alert("Error : " + result);
$.LoadingOverlay('hide');
}
});
}
==================================
function arrayBufferToString(buffer) {
var bufView = new Uint8Array(buffer);
var length = bufView.length;
var result = '';
var addition = Math.pow(2, 16) - 1;
for (var i = 0; i < length; i += addition) {
if (i + addition > length) {
addition = length - i;
}
result += String.fromCharCode.apply(null, bufView.subarray(i, i + addition));
}
return result;
}