Share to download - download

How to make a share to download system?
Means the visitor must share the content on a social network to get the desired file.
eg.W3layouts.com I must share the article to download the file.
NB: No third party solution. I want to know how it work and create a new one
Thank you

I will just use Twitter as an example:
You would use a Twitter web intent to track the user's click on your widget to share whatever content you want shared, seen in this page: https://dev.twitter.com/web/javascript/events . Use the 'tweet' event to listen for when the user interacts with the button. When you've verified that this event has fired, call the function that downloads the file to the user's computer.
Another thing, take to Google before you go asking it on StackOverflow.

Related

How to build WOPI validation application

http://wopi.readthedocs.io/en/latest/build_test_ship/validator.html
As per this documentation, we need to build some HTML host page.
In this document, they mention one point that I didn't understand completely
The simplest way to use the validation application is to use the view
action. To use the view action hosts should treat .wopitest files the
same way other Office documents are treated. In other words, hosts
should do the following:
Launch a host page pointed at the .wopitest file. Ideally, this should
be the same host page used to host regular Office Online sessions.
This will allow the validation application to test things like
PostMessage and do some validation on the way the Office Online iframe
was loaded.
What is .wopitest file and what I need to do exactly, Can anyone please guide me ? please explain stepwise
They mean that you have to call that action in the same way you call any other action (looking for the action url in the discovery, etc.).
For example, when you want to open a .docx for view, you look into the discovery.xml and you find that you have to call https://word-view.officeapps-df.live.com/wv/wordviewerframe.aspx?", and of course you must have ready the Rest services for that action (checkFileInfo, etc.) and the WOPISrc pointing to a file that in fact is a .docx . Well, for the validation application is exactly the same, but you should call to WopiTest app instead of Word app (inside the discovery) and your generated WOPISrc should point to a file called "xxxx.wopitest" instead "xxxx.docx". That's it! ;)

Realtime drive javascript example not working - Google API

I set up the Realtime drive example shown here: https://developers.google.com/drive/realtime/realtime-quickstart
On this site: http://shuub.com
But the thing is, that when I access the link from a different browser (logged in a different Google account), it won't load the file.
All I need is to edit some plain text with another user, without needing to access a google account, it doesn't even need to be saved after closing the site. Is it possible?
Thanks for reading.
But the thing is, that when I access the link from a different browser
(logged in a different Google account), it won't load the file.
Probably you need to share the file with the other user first.
Open Google Drive in your Browser. If you did not modify the example code, your file should be located in the root folder. It's probably named "New Realtime Quickstart File". Right-click on the file and share it with the other user by adding his account to the list and granting all permissions.
All I need is to edit some plain text with another user, without
needing to access a google account, it doesn't even need to be saved
after closing the site. Is it possible?
The website you have linked is not reachable so I don't know what you want to do exactly.
Probably you could also use other and (in that use case without saving and login) simpler techniques like Mozillas TogetherJS (you can try it on jsfiddle.net) or you could use a tool like Etherpad.

How to add user-data in JOOMLA?

i wannt to build a website with user management. User should be able to loggin with different accounts, f.e. GMail, Facebook, .....
When the user is logged in he/she can upload pictures with geolocation data and some text.
All uploaded geolocations should be visualized on something like google-maps.
Unregisterd users can view the map, but can not change the data or upload anything.
To solve this requirement i decided to use JOOMLA 2.5. with the "plugin_googlemap_J25_J3x.v3.2" plugin.
Everything i know about JOOMLA is what i learned the last two days.So i am very new to it.
Currently i am stuck, because i do not know how to save the user-data (pictures with geolocation data and some text) in JOOMLA.
I asked google! For more than an hour now! Could not find anything, related to that topic!
So my concrete questions are:
I suppose it is not possible to extend the JOOMLA user data database with the user-data, or?
If this is not possible, than i need a second database which holds the user-data, or?
Does anyone knows a tutorial which solves this problem?
I found someting for wordpress "http://codecanyon.net/item/privatecontent-user-data-addon/2399731"
but i have to check if this solves my requirements.
Thanks
Try this,
First make a list of your requirement then go to JED(Joomla extension Directory). search for related extensions.
Here from your requirement ,
You need a Customized Joomla Registration form
Social Media logins
And so on, so check the details of requirement and extension available, In any way you may need some customization on the Application then you can create some plugins for Users events.
Hope it helps..

How to receive a file after drag and drop

I'm trying to build a web application that allows users to drag and drop a file from their desktop (like justbeamit.com) to an "icon" that represents another user, and so that the different user could receive it on the other side. I see that this is possible using the dropzone.js feature, but I want to know is how it's possible to link this with the receiving function so that the other user could download it simply after receiving a notification. I know it sounds complicated, but wish you guys could do good on me by providing knowledge on how to link the drag and drop functionality with a function that allows the other user to receive and download the file. Thanks!
If you are using MVC framework you can get the file from controller as body.request.body.dataParts.get

Logging image downloads

I'm trying to find a way of finding out who is downloading what image from an image gallery. Users can download using a button beside the thumbnail or right click and use the "save link as" Is it possible to relate a user session or ID to a "save link as" action from all browsers using either PHP or JavaScript.
Yes, my preferred way of doing this would be via PHP. You'd have to set up a script which would load up the file and send it to the user browser. This script would also be able to log the download somewhere (e.g. your database).
For example - in very rough pseudo-code:
download.php
$file = $_GET['file'];
updateFileCount($file);
header('Content-Type: image/jpeg');
sendFile($file);
Then, you just have your download link point to download.php instead of the actual file. (Note that updateFileCount and sendFile are functions that you would have to provide, of course - this script is an example of a download script which you could use)
Note: I highly recommend avoiding the use of $_GET['file'] to get the whole filename - malicious users could use it to retrieve sensitive files from your web server. But the safe use of PHP downloads is a topic for another question.
You need a gateway script, like ImageDownload.php?picture=me.jpg, or something like that.
That page whould return the image bytes, as well as logging that the image is downloaded.
Because the images being saved are on their computer locally there would be no way to get that kind of information as they have already retrieved the image from your system. Even with javascript the best I know that you could do is to log each time a user presses the second mousebutton using some kind of ajax'y stuff.
I don't really like the idea, but if you wanted to log everytime someone downloaded an image you could host the images inside a flash or java app that made it a requirement to click a download image button. That way the only way for them to get the image without doing that would be to either capture packets as they came into their side or take a screenshot.
Your server access logs should already have the request for the non-thumbnailed version of the file, so you just need to modify the log format to include the sessionid, which I presume you can map back to a user.
I agree strongly with the suggestion put forward by Phill Sacre. For what you are looking for this is the way to go.
It also has the benefit of being potentially able to keep the tracked files out of the direct web path so that they can't be direct linked to.
I use this method in a client site where the images are paid content so must be restricted access.

Resources