File Upload Field in EXT JS - extjs

I need to implement File Import functionality using EXT JS, I have gone through the examples it were helpful and clear.
Here now i need to import the file of type .txt alone.
For Eg : Once the import pop-up blows, then the "Files of Type should be *.txt"
Please provide the your valuable inputs.
Thanks
Dinesh Kumar A B

Unfortunately, you cannot filter the actual File "Browse" window, unless you are using a Flash implementation or some other way of displaying that window. That window is handled by the browser, and is handled differently across OS' as well as browsers.
This is possible if you were say, writing a C# application, since that application would have access to the actual OS' window controls.
You could implement SWF Upload, or something similar which would allow you to do filtering based on file type.

The upload that you have seen in the examples uses TextField. You can configure it with a regex which allows only names ending with .txt
If the uses picks a non-txt file, the form becomes invalid and cannot be submitted.

Related

Looking for Editor that can handle .doc or .docx files

i am writing a web application with React, where users can write protocolls for their appointments. The current system is: the web application saves the word file in the local file system, the user edits it and uploads it via a macro in word.
That seems a bit clunky to me and i am not so sure about the security issues of letting the browser directly access the local file system.
So i wanted to let the users edit the files directly via the browser, with an editor similar to GoogleDocs.
Problem is:
Documents have to remain on premis
Converting doc files to a format that can be displayed in a browser and back seems to have some formating issues.
The user must be able to download the file and edit it, in case they have an appointment without internet access and upload it later. So it has to be at least convertable to a document that can be easily edited in Word.
There are so many richtext editor, but from what ive seen none is designed for that use-case. So my question is: Is what i want to do even possible, and if so does anyone know a good editor or library for doing so?

How to extract a Font Family name on uploading a font file (TTF and/or WOFF)?

I'm building a web-based tool to set up dynamic UI config for another generically formatted web app. It allow the user to specify basic UI colours, images,etc. Additionally, it allows the user to upload a (TTF or WOFF) file containing a custom font.
I would like to be able to interrogate the uploaded font file and dynamically show the font Family Name, to allow visual confirmation that the correct font file has been uploaded. I'd also like to show some text in the uploaded font, as additional confirmation.
The UI is written in AngularJS.
Is this feasible within the browser, or is a call back to back-end (.NET) the only solution...?
Note: I'm not asking for a full solution (that would take all the fun out of it!) but an indication of whether this is even possible and maybe a pointer or two would be gratefully received.
cheers

File Maker Scripting - Sending Different Attachment

Is there a way to send a mail with different PDF file to different contacts using file maker?
I am aware of sending batch emails with one attachment but I would like to send a personalize PDF for each contact which seems not so simple.
Also
Can I add PDF files to the table itself or would I have to use the path to the file?
Example:
Table 1
**Name** [James Brown] [James Blue]
**Email** [brown.j#gmail.com] [blue.j#gmail.com]
**PDFfileAttchamnet** [folder/PDF/JamesBrown.pdf] [folder/PDF/JamesBlue.pdf]
So an Email for James Brown would look like:
Dear James Brown, please see the attached file.
Attachment [JamesBrown.pdf] {actual file}
and
Dear James Blue, please see the attached file.
Attachment [JamesBlue.pdf] {actual file}
I think you can solve it by creating container field in you database and import the pdfs in it.
then you can use export Field Contents[] to export it and send it by email
Hope it useful
I would like to send a personalize PDF for each contact which seems
not so simple.
Find the records of contacts you want to include and loop among them, sending mail to each one individually (i.e. without selecting the 'Collect addresses across found set' option).
Can I add PDF files to the table itself or would I have to use the
path to the file?
You can do either, it's up to you. If the path to the file can be calculated (as in your example), you can calculate it right there in the Send Mail script step.
Note that you can also generate the PDF files during the process itself.
Do I understand correctly that you would actually like to personalize the PDF document(s)?
This is possible, maybe not very simple, but quite simple. The trick is to prepare the PDF as a form, and then fill the form fields to personalize.
PDF has a native forms data format (called FDF), which is described in ISO 32000 (as well as the older PDF specification documents provided by Adobe, as you can find in the Acrobat SDK, downloadable from the Adobe website).
FDF is a simple structured text file, which can easily be assembled using FileMaker (I have done that routinely for several catalog projects). The easiest way to get going is to open the form in Acrobat, fill in the fields, and then export the data as FDF. This gives you the pattern to "fill in the blanks".
So, you create the FDF files using Filemaker. With them you can fill the blank form and feed the saved document to the eMail system.
Which tool to use to fill the blank form depends on the volume you have to process. Acrobat is not very powerful (and you may end up in a bit of a legal gray zone, because Acrobat is not set up for being used as a service). There are applications which are made specifically for filling out forms on a server (such as FDFMerge by Appligent), or there are also several libraries which have the tools to fill out forms (iText or pdflib come to my mind). These applications also allow you to flatten the PDF, which means that there are no longer form fields, but their contents becomes part of the base.
The resulting file can now be either made to an eMail attachment, or you make it available on a server and send an eMail with the link to the file (which method you will use may depend on security and privacy regulations).

Winforms - Open external pdf file

I've Googled and searched stackoverflow for this but I've not found an answer that is suitable.
All I want to do is place a button a form, the code behind this button will contain a reference to a location on a harddrive where a pdf file is stored. All I want to do is have it so that when the user clicks the button the pdf file opens in the machines selected pdf reader (this is an internal application so the 2-3 machines that access it will always have adobe acrobat on them).
I've no idea which (if any) of the built in .NET classes can do this.
EDIT: There will be 100's of pdfs all added throughout time, I will have a path reference to one pdf per order in my system which points to a file storage server where the PDF lies. The PDF is not locally hosted.
How can this be done in the simplest sense?
You can simply use this code
System.Diagnostics.Process.Start(#"c:\myPdf.pdf");
It will open the file you provide with its associated default program

How to create a api in HTML 5 that is cut/copy/paste

I was planning to create a new web app based on extjs, but i need to create a file upload area where i can work on file uploading , i have tried drag and drop method in html 5 but we don't need that, we need a method where a user can copy a file whatever it is(not big than 20 mb)and that file location got copied on the clipboard and when we paste the file in the selected area of the uploader and the file gets uploaded, what is the best way to go about this?
There is no general access to the clipboard from browsers these days. There is a flash object called zeroclipboard that can be used for some clipboard access.
For your particular need (if all the data is exchanged within your page), you may not need to use the actual clipboard and perhaps you can just use some global storage to store things that are copied for later paste (using your own copy/paste instead of clipboard operations).
This Specification to achieve this is: http://dev.w3.org/2006/webapi/clipops/
But seens that it isn't implemented in any browser yet (perhaps IE9)
This could help you : https://stackoverflow.com/a/6338207/230526
If not interested in standard based solution, firefox, because of the plugins API, have a workaround for this, that you can see here: https://developer.mozilla.org/en/Using_the_Clipboard
I also found this piece of code that promises to work on Webkit based browsers: http://forum.maxthon.com/viewthread.php?tid=79469&page=1#pid493997
If you need to have all browsers support, then Zero Clipboard as stated here, is the way to go.
UPDATE: Found this Jquery based script ( http://archive.plugins.jquery.com/project/clipboard ), that uses IE native API to access clipboard and Flash to all others. This could be a start point to merge all the others solutions and fallback to flash whether not available.
For Zero Clipboard, there is this one: http://www.steamdev.com/zclip/

Resources