Is there anyway to attach a file from a path or directly in a email output node in IIB ?
I want to attach a file from a local directory as an attachment and send mail with that attachment using the email output node.
Any links or guidance will be really helpful.
You could use the FileRead node inline to read a BLOB into the LE. I can't think of way that you can currently avoid bringing the data actually into the message tree though.
It would make a good enhancement request which you could submit here: https://www.ibm.com/developerworks/rfe/?PROD_ID=532
Related
I need to upload a file repeatedly by browser (automatic) and refresh time ask me for confirm.
How can i to POST form with a specified file?
Sorry my english
It would be nice if you make available what you already tried, then we know where you are getting stuck.
Basically if you need to upload a file to a remote server you will need a dynamic language like PHP, Python, etc.
You can't send files to a remote server using plain HTML.
For security reasons HTML itself won't let you send files to a remote webserver via <form> automatically.
For that feature you would have to have your webserver handle the form via a special file like for example <form action="exampleFormHandler.php" method="post">.
Placed at your webserver, this form-handling file would have to provide the sending of that very file then.
I have a form where I simultaneously send several (let's say 10) files to the backend, along with some other regular input fields.
When I find a validation problem in the backend I display the form again and fill the regular inputs (dropdowns, text inputs, etc.), but I cannot fill the file fields, forcing the user to select the files from the file directory again.
The solution I think of is sending the base64 encoded representation of the files, and put them back in the form in case there is a validation error, but I would like to know if there is a simpler way.
No matter what you do, you can not skip server-side validation. For security reasons (someone sending raw requests for example). As far as showing the files in case of error (or simple reloading) I would send it as Base64, but via AJAX if the files are large.
Client-side validation: most validations (if not all) can be done using plain JS. Be it filesize, content type... and more specific validations according to filetypes (image, document...)
Server-side validation: Once sent, fully validate the file and content.
Send files back:In case of error, send the files with the request if small. If big send them via AJAX to avoid blocking and keep page loading times fast.
Hope it helps!
The simplest thing to do would be :
1) Validate all fields on the client side (javascript/jquery)
2) Once all other inputs are validated, then you send in Files.
NB: If you need to validate some values on the server side, use ajax for both steps (1) and (2). Also, try to give a bit more details to get quality answers
I would create a temporary store for uploaded files and would send back only a unique-hard-to-guess ID got from the store instead than the whole file.
The form section for a single file upload would then include also an hidden input carrying the unique file-ID.
When processing the request: if there is a file in the request get the file (and store it if form not valid) otherwise if there is a file-ID get the file from store.
I'm trying to store links to files uploaded with phpmailer in my MySQL database so that when a web page calls the record, the user can download the files.
My files were getting attached as I want before I added the anchor tag. Now they no longer get attached to the email, and only the file names are making it into the database. Am I missing something simple?
$mail->AddAttachment("<a href='/home/company/upload/'>".$_FILES['rfile']['name'][0]."</a>"); // add attachments
$mail->AddAttachment("<a href='/home/company/upload/'>".$_FILES['rfile']['name'][1]."</a>"); // add attachments
Why are you putting HTML into something that's expecting a path to a file? Do this instead (and pay attention to what Marc B said - you should be calling move_uploaded_file() somewhere.).
$mail->AddAttachment('/home/company/upload/'.$_FILES['rfile']['name'][0]);
$mail->AddAttachment('/home/company/upload/'.$_FILES['rfile']['name'][1]);
I have a strange situation, I need to run a custom criptography on a file in the moment that the user choose the file to be uploaded.
To achieve that I am running an Applet to crypt the file at the onSubmit event, but once I get the the crypted string from the Applet how can I send that as a regular file upload?
Is there a way to create a blob and then attach it to the file input?
I dont'have access to change the application source code, everything that I can do is write a custom Javascript.
Any help would be appreciated! Thx!
(I am sorry if my question is not in the right place. (I've been thinking for awhile and came up to the conclusion that this one is the best place for my question)
Is it possible to create such an HTML web-page that would provide a user to download a certain file from it, but would not disclose the location of that file (i.e. the user would not know the URL of the file that he is downloading).
If yes, would you, please, give me some directions as to which HTML code I should use to create such a page.
The HTML page would provide a link to a server side script passing a filename or other unique moniker:
Download Now
The script would read the identifier, derive a full path from it, load the file and write it back with the appropriate headers/mime type causing the browser to prompt the user with the normal download dialog.
The only location data available to the user would be the link to the script - which would - unless you add some security - serve back the file just as if it were a standard url pointing to a file.
(PHP Example)
With pure html, no. But with a serverside script (php, c#, vb, perl, or other) yes. You would stream the file to user. In that case just the serverside script has access to the origin files