I'm trying to do a simple image POST to a php script through FileMaker Pro. I have the image in a container. Is there a way to post this to my URL so that I can use the normal PHP upload etc to take care of the processing? Any plugin etc that can help me do this?
Thanks.
The easiest way that I know of is to use a third party plug in like:
http://www.troi.com/software/urlplugin.html
Because you can't just "get" the contents of the container you'll need to write the container to disk and then use a plugin like troi file to "read" in the image data. You may also want to use a plugin like troi text to encode the image before uploading (base64 is pretty common) and then decode it on the php side.
Related
Hello guys I need help here,
I want to send PDF mails to users on a monthly basics. but the PDF will have values from the db. so each users has a different content from another user all taking values from db. If i can't achieve this perfectly on Laravel I need another language that can help me achieve this thanks.
$schedule->command('custom:command')
->monthly();
You can achieve anything in Laravel which you can achieve in PHP :) and as far as web development is concerned, you can achieve anything in PHP :)
However, I am not sure what exactly is your question about so I will answer all aspects of sending an email with dynamic pdf.
Get fillable PDF
First of all, you need fillable fields in your pdf in order to generate a dynamic pdf in run time. If you dont have fillable fields in your pdf, you can create them using any online tool. One example is: https://www.pdfescape.com/
You can also use Adobe to do so if you like.
Create a PDF with dynamic data
Once you have your empty, fillable PDF, then you can populate the data in it using PDFTK library. Of course, you will have to install this tool in your Server in order to use it.
I recommend using it directly, running exec or similar commands in PHP. However, if you are not comfortable, you can use various Pdftk wrapper, available in Laravel. One example is: https://github.com/mikehaertl/php-pdftk
I myself prefer using exec directly from PHP. Here is a REALLY GOOD tutorial for that: https://www.sitepoint.com/filling-pdf-forms-pdftk-php/
Send the email
Well once you have your PDF generated and saved on Server, all you need to do is attach it with your email and send. You can find all about attachments in Laravel here: https://laravel.com/docs/5.1/mail#attachments
Run it via cron
If you have to do it on a regular basis. I advise you create a cron on your Server. There are various ways to do that. I advise you do it via cPanel, if you have one on your server of course as it provides very user-friendly way of creating crons. If not, you can also use terminal to edit the cron files in Linux Server.
I do not recommend using Laravel inbuild scheduler because it has known issues.
Well that's it, voila..that's the whole process of sending dynamically generated PDFs via email on regular basis.
Good luck!
I trying to use CKEditor5 and CKEditor-react in my electron app.
And i want to paste image in editor, but i have an error
filerepository-no-upload-adapter: Upload adapter is not defined.
Docs says that I mast using cloud. But my app must working locally and without internet
Can someone help me?
The docs say, in short, this:
To handle image upload in CKEditor 5 you can use one of these:
use the built-in Easy Image adapter (cloud service),
use the built-in CKFinder adapter (can work locally if you want),
write your own adapter (in which case, please refer to the UploadAdapter interface documentation).
The last option gives you a complete freedom on how and where you want to send those files.
PS. You can find a bit more details in this question: How to enable image upload support in CKEditor 5?
I'm quite new to addons development on Firefox.
I need to store an image from a given url, and then get the path to upload on another web. I read the Mozilla docs but can't figure how to do this.
I appreciate any help.
This does exactly what you need: How to download image to desktop with OS.File - you download the image with XHR, you then write that data to anywhere you want with OS.File.writeAtomic Instead of that XHR function, because you are using the SDK you should use the request module - https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/request
is it possible to create a file in my Dropbox/Google drive (or any could service) via HTTP POST and GET only ?
I want to send a HTTP POST with text content in it and whatever the content is it will be written to a file in my storage.
i was able to do this on a free web hosting using PHP but it is possible to be done on could or maybe is it possible to host PHP on cloud so i can use the same PHP code the i used on the site ?
Yes, this is possible. For Dropbox, see https://www.dropbox.com/developers/core/docs#files_put.
For Drive, see Uploading files. It talks through the steps for uploading file content over http.
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.