How To Write Your Own FTP Uploader with Automator - xcode

Is it possible to write your own application/command that will allow you to automatically upload your files to your ftp server?
Basically the flow I want to achieve is this
My app/action/whatever is scheduled to upload at a certain time
When the certain time arrives, the files in my specified folder will be uploaded
Of course, to upload, some data must be set like the username, password, ftp server etc...
After my files have been uploaded, the local files will be wiped-out.
I don't exactly know where to start. Can someone help me with this. Thank you.

Take a look at http://editkid.com/upload_to_ftp/. It comes with the source code so you can modify it to fit your needs. You can combine it with an Automator action to delete the files after upload.
To schedule it, http://smallbusiness.chron.com/schedule-automator-tasks-mac-os-x-39132.html.

Related

check if file exist on Sharepoint Online by File Name with Power Automate

I am trying to create a flow in Power Automate Cloud that allows me to extract some files from Google Drive and copy them to a Sharepoint folder. But before copying it, it has to check by the file name, that the file does not already exist in the sharepoint folder. I have managed to do the whole flow, except the checking.
I would be very grateful for your help.
Thank you very much. Best regards.
A File exists action doesn't currently exist but you can use the Get file metadata using path action from the SharePoint connector to do the same sort of thing.
This flow below shows you an example of what you can do ...
For demonstration purposes, I've created an array with a list of file names (full path required) that I will then test the existence for.
One of those files doesn't exist.
I then loop through each one of those and try and get the metadata for each file.
If the resulting statusCode from the call to get the metadata is not equal to 200, then we know the file doesn't exist.
Examples ...
To make this work however, you need to make sure that the Condition step will execute after the metadata call no matter what the result.
Do this by making sure the Configure run after settings are correct ...
So after all of that, all you need to do is deal with the true and false sections of the condition.

How to check if a csv file has been uploaded in a drive daily and alert user if not?

I have been assigned a task of automating a manual activity which involves checking if a particular data file has been uploaded in a drive daily.The file is a .csv file added incrementally(once) every morning and named based on the date and time it has been uploaded.
In case the file is not present in the drive folder there should be a trigger alert to the stakeholders in the form of email.
What are the automation tools I can use to automate this particular activity?
My current plan is to write a java code that checks the folder.Using Jenkins I will run it everyday and trigger email alert in case a particular file is not present.
Is there any easier way to do this?

How to simple test the file download and upload?

I have two api for file download and upload. (/static/{filename} api for downloading, /upload api for uploading) For consistency, it need a test file to ensure the functionality of them two. I check the official fs_test.go, but it is too massive to use, is there a trick way to do it?
Do you need a unit test? If you are supposed to test saving the file you can use a brute force.
Create file
Check if it exists (optional: check the file data)
Delete file

Email Alert for Inserting/updating/removing files inside folder in windows7

i have above mentioned case happen at our company, they need to know under certain folder whether its shared or not if any files inserted or removed or update to send alert by email periodically for that action, any thought an ideas please
You can fairly easily create an application in C# that monitors a folder using the FileSystemMonitor class:
https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher%28v=vs.110%29.aspx
With that you can then have it perform whatever actions you want.

I'm told to down load a text file from another website and to put in the root directory of my website

I want to know how to down load a text file from another website and how to put it in the root directory of my website.Can you help me with problem please.THANK'S !!
As a program, or as a human action?
As a human, you should be able to take the link and download the file, upload to your website using for example FTP or (hopefully no one does this now) frontpage.
If you mean programattically, well its almost the same. Your script would need to open the file in the root directory, open the URL and read in the data sent and save it to the file, close the file. However, how to do so exactly depends on the lanugage you want, is this a repeated event or a once off?
This type of request usually happens when you are requesting a service that requires proof that you are the website owner. Being the owner of that website would also indicate that you should have at least ftp access over your site. If you are hosting the website yourself, this is an easy task you just copy the file into the root directory (windows default is c:\inetpub\wwwroot, ubuntu default is /var/www/). However if your website is hosted, you need to find your ftp username and password and utilize an ftp program like FileZilla. If you want to tell us what file host you use maybe someone can give you exact instructions. But beware of what file you host.
If you have the URL of the text file you can put it into your browser and then save the file to your disk. You then need to FTP it to your web server (or whatever method you normally use to get files onto the server)
In PHP:
<?php
$resource = curl_init('http://www.someserver.com/file.txt');
// important, otherwise curl_exec will output directly
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$data = curl_exec($resource);
curl_close($resource);
file_put_contents('/dir/localfile.txt', $data);
Or even better, with a bash script with a simple wget and cp.

Resources