Where Can I access My Mautic campaign content (File path) - mautic

Im trying to extract all of my sms content and email content from a mautic install and put it into another install. What is the file path where these are stored?

As suggested, the data will be stored in your database, and any files uploaded will be in the file system (most likely in /media/images if you didn't modify the location).

Related

Make pdf file accessible through a link in the app

I've been searching for weeks on stackoverflow and google, but I wasn't able to find any good results.
I have a pdf file on my computer and I want to access that pdf file from an ios app, by clicking a link which will take me to that pdf file.
And when I modify that pdf file on my computer I want the link in the app to update with the latest version of that pdf file.
I thought of using a backend for storage such as Firebase storage but I had some issues with that.
How can I access that pdf file from an app? It doesn't have to be through a link, anything that will allow access with the latest version of the file is fine.
I appreciate any suggestions.
Thank You
The simplest way may be using a cloud storage such as Dropbox, Google Drive, One Drive...etc and get the public share link to that file. Then you can load the PDF in your iOS app using this link.
You can do this using web services API, You need to create simple webservice in backend (in any language for example PHP) to get the list of file with path to access in mobile app, and configure backend webservice code to your server (your computer, wherever you want to update files), So you can get every time updated data (files path) using webservice.

How to prompt user to specify a file location in Vaadin 7

I have feature that exports and generates csv using opencsv in vaadin 7. The problem I have is how to get a file location to save a file on users local machine.
Below is a line that needs a path to where to save a generated file.
CSVWriter writer = new CSVWriter(new FileWriter("H:\\dummy\\export"+timestamp+".csv"));
Instead of having a static file path, I need to prompt the user for where to save a file, as well as how the user wants to name a file.
I appreciate your help.
You have no chance to influence the location of a file that a user downloads.
Here you can find a sample how to create a download with vaadin:
Letting The User Download A File
Note: The Vaadin7 Link broke, this is for Vaadin8 but still helpful.

How can I link to a file in an email?

When I'm sending mail form in my app I can attach some files. But in the email it looks like aeb6fe78271a1f2f51c7b84981b9e8df.png How can I show link to file?
if the file is hosted in the web. then checked it out the file link inside the email, maybe the generated file url is a relative path which did not contain the host information.
another solution maybe attach the file as an attachment inside the send email.

Keeping GoogleDrive files in sync with local files

I'm integrating Google Drive into an iOS app with the SDK, (which works great, thank you) and I would like to keep a set of files on Google Drive in sync with files on the device. By this I mean: When a user renames or moves a file on their device, I'd like it to rename/move on the server. If a user renames a folder, I'd like to rename that folder on the server.
With other cloud services that use a path to identify files, I can generate the path to rename or move the files on the server whenever I need them. With Google Drive, this is not the case--I need a file ID to rename or move something. Is there a convenient way to get the file ID from a path? Will I have to store information from Google Drive in my app? Is there a recommended best practice for this situation? Thanks for any help!
As far as I can see, you can keep a list of file ID when initially you insert file into Google Drive. When you insert a file into Google Drive, it will return a file resource which contains the inserted file ID and it doesnt change unless you delete it.

where is the best place to save images from users upload

I have a website that shows galleries. Users can upload their own content from the web (by entering a URL) or by uploading a picture from their computer.
I am storing the URL in the database which works fine for the first use case but I need to figure out where to store the actual images if a user does a upload from their computer.
Is there any recommendation here or best practice on where I should store these?
Should I save them in the appdata or content folders? Should they not be stored with the website at all because it's user content?
You should NOT store the user uploads anywhere they can be directly accessed by a known URL within your site structure. This is a security risk as users could upload .htm file and .js files. Even a file with the correct extension can contain malicious code that can be executed in the context of your site by an authenticated user allowing server-side or client-side attacks.
See for example http://www.acunetix.com/websitesecurity/upload-forms-threat.htm and What security issues appear when users can upload their own files? which mention some of the issues you need to be aware of before you allow users to upload files and then present them for download within your site.
Don't put the files within your normal web site directory structure
Don't use the original file name the user gave you. You can add a content disposition header with the original file name so they can download it again as the same file name but the path and file name on the server shouldn't be something the user can influence.
Don't trust image files - resize them and offer only the resized version for subsequent download
Don't trust mime types or file extensions, open the file and manipulate it to make sure it's what it claims to be.
Limit the upload size and time.
Depending on the resources you have to implement something like this, it is extremely beneficial to store all this stuff in Amazon S3.
Once you get the upload you simply push it over to Amazon and pop the URL in your database as you're doing with the other images. As mentioned above it would probably be wise to open up the image and resize it before sending it over. This both checks it is actually an image and makes sure you don't accidentally present a full camera resolution image to an end user.
Doing this now will make it much, much easier if you ever have to migrate/failover your site and don't want to sync gigabytes of image assets.
One way is to store the image in a database table with a varbinary field.
Another way would be to store the image in the App_Data folder, and create a subfolder for each user (~/App_Data/[userid]/myImage.png).
For both approaches you'd need to create a separate action method that makes it possible to access the images.
While uploading images you need to verify the content of the file before uploading it. The file extension method is not trustable.
Use magic number method to verify the file content which will be an easy way.
See the stackoverflow post and see the list of magic numbers
One way of saving the file is converting it to binary format and save in our database and next method is using App_Data folder.
The storage option is based on your requirement. See this post also
Set upload limit by setting maxRequestLength property to Web.Config like this, where the size of file is specified in KB
<httpRuntime maxRequestLength="51200" executionTimeout="3600" />
You can save your trusted data just in parallel of htdocs/www folder so that any user can not access that folder. Also you can add .htaccess authentication on your trusted data (for .htaccess you should kept your .htpasswd file in parallel of htdocs/www folder) if you are using apache.

Resources