How to integrate epub file in own ebook reader application using ExpressPlay sdk? - ios

I have to integrate epub files in our existing ebook reader application by using ExpressPlay Sdk.However, I am unable to get solution.
I got some idea by given link : https://www.expressplay.com/ebooks/
but it is still not able to integrate.
Any idea will be appreciated.
Thanks in advance.

We need to setup proper details while encrypting file. And need to use token for the decryption.
So here are the steps to follow :
1. Encryption using bento4 packaging tools :
(You can find tools here : https://www.bento4.com/downloads/ ) :
Extract the package to some dir and open Terminal or CMD to that path
Follow the command
mp4dcfpackager --method CBC --key
CONTENT_KEY:00112233445566778899aabbccddeeff --content-id
CONTENT_ID --content-type CONTENT_TYPE
INPUT_FILE_PATH OUTPUT_FILE_NAME
Where,
CONTENT_KEY : content_key from https://admin.expressplay.com/bblicensetoken/
CONTENT_ID : content_id from https://admin.expressplay.com/bblicensetoken/
CONTENT_TYPE : for PDF use, application/pdf || for ePUB use application/epub
INPUT_FILE_PATH : File to be converted with DRM content
OUTPUT_FILE_PATH : File name after encryption (make file name same as input file name with extension so you can differentiate file type at app side)
2. Create a Marlin BB License Token (BB Token is used for offline validation):
Add following parameters from https://admin.expressplay.com/bblicensetoken/ :
Content ID
Content Key
Rights Type : "Buy to Own"
Output Control Override Id : "urn:marlin:organization:intertrust:wudo"
Output Control Override Parameter : "ImageContraintLevel"
Output Control Override Value : "0"
Wudo Extension = true
Click on Get Token
Store file to your project
Now, you can get an idea from the samples they provided in SDK that how to use this token file with project.
If you still have any confusion let me know. I've followed the same steps for android so it should work for iOS too.
Thanks.

Related

Is there any offline safe method to prevent web-shell uploading in aspnet?

I have a simple page in asp net 5, and users can upload their images there. Valid files are: *.jpg, *.png, so I'm doing steps below to validating the files:
Validating filename length : e.g: file name must be less than 50 alphabet characters
Validating filename : replacing any hidden or invalid characters
Validating file size : based on our configurations (e.g: less than 10MB)
Validating file extensions : based on our white-list: *.jpg, *.png
Validating Mimetypes : based on our white-list for IMAGE/JPEG, IMAGE/PNG
Validating file's first bytes (Magic Number) : based on our white-list for JPG: "FF-D8-FF-DB", "FF-D8-FF-E0" , "FF-D8-FF-EE" ,"FF-D8-FF-E1" and PNG: "89-50-4E-47"
Uploading the file with a random (guid) filename in the temp folder outside webroot: without any executing permissions.
Scanning the file with AV (Kaspersky or Norton Security) service installed.
But, some webshells can bypass these steps, like Insomnia webshell or others (they use the magic number headers at the first of file headers and inject their codes into some part of the file).
So my question is :
how can I detect and prevent webshell uploading?
Should I read and check the whole file for some black-list keywords?
Or what?
btw :We can't use any online webshell detection services.
This is a simple shell injected into a PNG file by woanware.co.uk:

Set file encoding

I'm currently struggeling with following issue.
Developing in Lua
Different file encoding per file extension (for instance: "*.lua" -> iso88591, "*.lu8" -> utf8)
Actually there is no way to solve this in the settings.json (only per language).
So I decided to develop an extension setting the charset per file name (custom setting charset.assignment).
settings.json
...
"files.associations": {
"*.lu8": "lua"
},
"[lua]": {
"files.encoding": "utf8"
},
"charset.assignment": {
"*.lua": "iso88591"
},
...
So now I "only" have to set the character set of the current file in my extension.ts, but I didn't find any opportunity to do this. At the moment I'm trying to execute the workbench command workbench.action.editor.changeEncoding, it shows up, but I still have to manually chose the character set.Anyone knows, if it's possible to refer some parameters to the command (like vscode.commands.executeCommand('workbench.action.editor.changeEncoding', 'iso88591');?
Similar question (but for getting the current charset):
VSCode: activeTextEditor encoding
Links:
Provide encoding-related APIs for editor extensions
add support for charset
ChangeEncodingAction
File extension specific settings

Filename not assigned to csv export in HighCharts on Mac

I am using the EXPORT-CSV plugin for Highcharts to export data to csv. (Thank you to the developers of this plugin!) When testing in Safari on a Mac, however, the exported csv file does not take the filename as expected from
exporting: {
filename: "FancyFileName"
}
and instead just uses the default Highcharts name "chart". All the built-in export types do use the desired filename from Safari, and the csv also gets the desired filename from all the other standard browsers I have tested.
Here is a fiddle.
How can Safari be convinced to use the filename I give it? Thanks for your help.
The hard coded filename is coming from the php script written on the server. You can find that script on php script for download of file with hardcoded file name
You can use that same code on your local machine server. To do that
create a php file on your local server.
copy the above code in it.
change url www.highcharts.com/studies/csv-export/csv.php in export.csv library to your local server url.
change the name whatever you wish to using $_POST['variablename']
Variable name should be pass when making post call from export.csv library and use in php file using $_POST
Highcharts.post(url, {
data: content,
name: name,
type: MIME,
extension: extension
});
This is the code used in export.csv library for making post call. I have added extra parameter name to be used in my php script for dynamic filename.

In Dart, how can I save a string to a user's local file, without using dart.io?

I have a Dart [client side only, polymer] web-app. So I cannot use dart.io. I would like to do this semi-pseudo (language/platform mix!) code:
..
String str = "a load of text";
File file = new File('C:\\folder\\test.txt');
file.write(str);
file.close();
or
window.clipboard.copy(str);
so the user can paste it. I have used a TextAreaElement to put the string on (using textarea.value=str), and then the user can copy and paste it himself, but that's a bit naff.
Thanks
Steve
Sorry, you cannot write to files on the file system from a web app. The restriction is from browsers and their security model.

TCPDF generated PDF to automatically display in Acrobat Reader

I am able to use TCPDF and generate a PDF in the browser using JQuery/JavaScript:
window.open("", "pdfWindow",scrollbars=yes, resizable=yes, top=500, left=500, width=400, height=400");
$("#" + formID).attr('action','tcpdf/example/genReport.pdf').attr('target','pdfWindow');
In genReport.pdf, I am using $pdf->Output('genReport.pdf', 'I');
When genReport.pdf is generated, it appears in a new tab with the standard browser settings. I wanted to know if there is a way to have the generated PDF automatically display in Acrobat Reader?
Any help will be greatly appreciated.
According to the documentation of the output() function, the second parameter can be one of those:
I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects
the "Save as" option on the link generating the PDF.
D: send to the browser and force a file download with the name given by name.
F: save to a local server file with the name given by name.
S: return the document as a string (name is ignored).
FI: equivalent to F + I option
FD: equivalent to F + D option
E: return the document as base64 mime multi-part email attachment (RFC 2045)
So I'd suggest using $pdf->Output('genReport.pdf', 'D'); this will open the download dialog and the user can choose to either open or download the file.

Resources