Automaticly show email content on a webpage? - html

For a certain application I need to show the attachment of an email on a website.. (it's a private site so not open for public).. the attachment is a html file. The file is emailed to my specified address every 30 mins. I need to display these contents on a autorefreshing webpage. What the easiest way to get this done? I was thinking writing a cronscript that checks the mailserver every 30 mins, downloads the attachment and places it in a certain place.. but maybe someone outthere has a better idea?

Yes, it looks reasonable to split this task into parts. Craft one cronscript which downloads incoming messages to an ordered storage (file system will suffice, if you are cautious about backing it up). Then craft a webpage that present some view of that storage.
Another, more straightforward solution would be to have one single webpage script which polls email server, downloads latest file and displays it. If it works too slow, you may just add some disk caching with proper timing out. This is for the case if you have a single message to display.

Related

Get downloads & file browsing requests from HTMLFrame

I am able to load and display files using the HTMLLoader class. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/html/HTMLLoader.html
Problem is, when a user navigates to a download link or an upload button, nothing happens. I heard somewhere that any downloads get sent over to the user's main document folder. Anyway to intercept this and get some details? Someone in my browsing history suggested to somehow get it using the Socket class to fetch it's data and control where it would go using the File class. I couldn't make out the demonstration.
Bonus question...what properties do I have to set to make Google understand that this browser is not a bot? I get this in plain text when trying to navgiate to http://www.google.com . It's other services work completely fine though.
Google
Sorry...
We're sorry...
... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now.

WP 8.1 Downloading a file and saving it

I'm developing a Windows Phone 8.1 (non silverlight) project and i'm very new to the platform.
I'm having a really hard time trying to access a pdf file from the web and saving it to the phone. First, i searched for how to display the pdf file inside the app without saving it, and learned that it can't be done.
Then i searched for a way to download the file and save it localy. Every example i found ended it up in a dead end; i tried with WebClient, and found out that i must switch to HttpClient, i tried with IsolateStorageFile and found that i must use ApplicationDataContainer.
It's becoming really frustrating searching for simple things for hours and hours without any result.
Can someone point me to an example, or anything else ?
Downloading a file for the user means that you have to take care of a variety of things:
1) The app must stay responsive while the user waits for the download to complete.
2) You have to provide some kind of status information.
3) The download should continue if your app gets suspended (e.g.: the user hits the home button).
That's why big /unknown size or slow file downloads should be load off to a background task.
This article will provide you with a working example:
http://www.informit.com/articles/article.aspx?p=2229233&seqNum=6

Calling a Google Drive SDK from Google App Script application

i have been going around in circles here and have totally confused myself. I need some help.
I am (trying to) writing an application for a client that in concept is simple. he want a google write document with a button. the google drive account has several folders, each shared with several people. when he drops a new file in one of the folders, he wants to be able to open this write file, this file is the template for his email. he clicks the button, the system calls the changes service in the Google Drive SDK https://developers.google.com/drive/manage-changes, gets the list of files that have been added since the last time it was checked, then pull the list of people that the file has been shared with, and use the write file as a template to send that list of people an email saying their file is ready.
SO, easy enough, right?
I started by looking at the built in functions in the Google App Script API. I found this method, https://developers.google.com/apps-script/class_docslist#find in the DocsList class. problem is the description for the query simply says "the query string". So at first i tried the Drive SDK query parameters, which are
var files = DocsList.find("modifiedDate > 2012-12-20T12:00:00-08:00.");
it didn't work. that leads me to believe it is a simple full text search on the content. Thats not good enough.
That lead me into trying to call a Drive SDK method from within an App Script application. Great, we need an OLap 2 authentication. easy enough. found the objects in the script reference and hit my wall.
Client ID and Client Secret.
you see, when i create what this really is, a service account, the olap control in apps script doesn't know how to handle the encrypted json and pass it back and forth. Then when i tried to create and use an installed applications key, i get authentication errors because the controls again, don't know what to do with the workflow. and finally, when i try to create a web app key, i can't because i don't have the site host name or redirect URI. And i can't use the application key ability because since im working with files OLap 2 is required.
i used the anonymous olap for a while, but hit the limit of anonymous calls per day in the effort of trying to figure out the code a bit, thats not going to work because the guy is going to be pushing this button constantly thru the day.
i have been pounding my head on the desk over this for 5 hours now. i need some help here, can anyone give me a direction to go?
PS, yes, i know i can use the database controls and load the entire list of files into memory and compare it to the list of files in the database. problem being, we are talking tens of thousands of files. bad idea.
I wouldn't use DocsList anymore - DriveApp is supposed to be a more reliable replacement. Some of the commands have changed, so instead of find, use searchFiles. This should work more effectively (they even use a query like yours as an example).

File Upload progress on IE9

I've read in a few places that file upload progress is not supported in IE9.
However I notice that gmail has some sort of solution for it. I've read articles from a couple of years ago that it is a flash-based solution but when I got the inspector tool out, I couldn't see any flash objects. I'm wondering whether anything has changed in that time.
Is anybody able to describe how gmail has solved the 'file upload progress' problem in IE9?
I do not know how gmail does it, but one possible solution is to start the upload asynchronously (javascript, iframe, whatever) and then poll the upload progress regularly from the server.
Assuming you have some kind of session identifying the user, the upload is sent to the server which updates some progress variable in the user's session while the file is being transferred. At the same time, the client polls the progress variable once a second via separate AJAX calls to the server.

Forms and ajax uploaded files

If I have form where user can upload files via Ajax (and upload is available only when JavaScript is turned on) and some other text fields etc. What if is user opens a new page for same form. Should that show already uploaded files, or are uploaded files only related to page where files where uploaded? I am asking this because I don't know what is common convention in these kind of situations.
I don't know that there is any convention, but if you have an authenticated user and you know that the user has uploaded a file for a certain form, I think it's a good idea to present the already uploaded file on the second instance of the form.
Key benefits are time, space and bandwidth saved by discouraging duplicate uploads. Another benefit is the perception that you are helping the user accomplish their task by eliminating the need to re-upload a file.
And I can't think of any drawbacks to showing the already uploaded files.
Hope this helps!