How to scan network directories / or a FTP server and alert me via email each day saying what new files have been upload to the server?
I have about 20+ directories at work with images that get updated by external parties, but rarely get told that they put the files there. Would make things easier if I had an alert along those lines.
In dotNet you can use the FileSystemWatcher class to get notified when new files arrive or when files change: FileSystemWatcher on MSDN
If you need a quick and easy solution you can use the freeware FTP Guard which provides exactly the functionality you describe.
Just schedule it to run e.g. every morning and you will have the information you need.
Related
I have an application where user stores files (on the server) and on it's own google drive. I would like to reflect document changes from drive to server files. The only way of achieving this I could think of is using push notifications api for drive files and if type of notification is content update to download and replace file on server side. Is there a better way of achieving this, since notifications are being received often (almost for each letter typed) and downloading file every second doesn't seem like optimal solution.
There are many ways in which you can handle this ...
You can poll the Google Drive server for its state every minute. Figure out what changed and download it. This can help.
You can also use an existing tool or another one to solve this problem.
Is it possible to upload a file in Play! framework only by giving a path in url?
For example I would like to call:
www.mywebsite.com/upload_PATH
It's for me quite important, because I would like to upload and process a lot of data. Selecting manually 1000 files is too much time consuming and I want to write a program which will make it for me :-) I'm using Play with Java.
If upload_PATH is a local file path on your system, it is not a good way to go.
You should write a Play action where you can upload a file, as it is done in this example.
Then, you should write a HTTP client (started by a main Java method) which go through your files and upload then calling the Play! action. You can use the httpclient Apache library for writing the client part.
As nico_ekito wrote www.mywebsite.com/upload_from_local_path won't work
In case of huge amount of files you can create temporary folder on the distant server and upload your files with FTP. Then in your app you'll need only action for post-upload processing, ie. it can check if file is valid and move it to calculated destination and register in database if required.
Other possibility is using some flash/ajax multi uploader for an example swfupload (don't know it, it's just first hit from the search engine). This approach will be better if you are going give the upload possibility to people who you don't want to give any FTP access.
Finally you can mix the solutions -> use uploader instead of FTP and later post-process new items remotely.
I'm looking into a small project just now where we have a need for a very very basic news article system. Ideally, this is a simple XML file that will be written to with some news, and then parsed to display on the homepage. This file is on the server, of course.
My question is how to allow a client browser to write to this XML file, given that the server will not have PHP enabled?
I know of TiddlyWiki which uses a .JAR file to allow the writes, but are there any other methods I should try?
Since FTP seems to be enabled/supported, your best bet is to create an applet which does the job. FTP connectivity can fairly simple be done by Apache Commons Net FTPClient. Your only problem is that the FTP connection details needs to be embedded in the applet somehow and that anyone with bad intent can extract it from the applet's source code since applets are downloaded into the client machine.
Without some serverside code, you will not be able to write files to the server.
You need a "PHP/Java/FTP-Server/something else"-backend serverprocess to take the content and write it to a file.
Apache supports HTTP PUT, and some browsers support it in XMLHttpRequest. So long as you are willing to limit editors to browsers that support it, you could use that without installing additional software on the server or using a plugin on the client.
FTP would definitely work, depending on how well the user doing the updates is familiar with it.
If the upload solution needs to be browser-based, you could perhaps run an FTP applet and have the user remember the connection details/password.
I have a Windows Server that recives mail. These mail contains only 1 single CSV file. I want my server to automatically take the attachment from any incoming mail and send to a java program locally installed. Is there anyone who can give me directions on any programs that fix this or do I need to create some kind of windows service?
Thankful for any help!
=>Write a program using threads and run in the Windows Server
=>Your thread will check a particular location (where the CSV will be stored) for every 5 minutes (give your own time interval of checking)
=>Process that file.
Hope this helps.
How do you receive the mail (service,script,application)? If you do via Outlook, things are pretty easy. Write a VBA script which extracts the attachment and saves in a folder somewhere. In the java application you implement a directory listener which fires if the directory has changed and pick up the new file.
Looking for a descent looking Java File Upload Applet (or even Flash) that fits the following requirements:
Free/cheap (yes looking to use in a commercial web application)
Preferably allow multiple file selection
Ability to create/edit folders on destination server? (within a secure root folder)
Ability to overwrite files in the destination directory?
IE + Firefox support required... Safari, Chrome, etc. a bonus
Ability to "hook" into the flow to apply additional logic
Notes:
In particular I'm looking for the ability to upload to a directory on another server (e.g. not where my web server or app server is running)
The destination server has a shared drive where all users of the app have permission to store files.
By "decent looking" I'd really, really like to avoid a UI that is "skinned" like this:
(source: swtguibuilder.com)
Before I'm shut down for "not programming related" I would need to be able to hook into such an applet to apply some additional permission logic etc. I don't want to re-invent the wheel if someone else has made a component that already does what I need.
This is relatively easy with Java. Look into Apache Commons Fileupload for the server-side code. For the front-end, there are many examples of flash-based file uploads.
The simple answer to your question used to be Flash. Since the release of Flash Player 10 it isn't anymore. Adobe has added a restriction on File upload which only allows a file to be uploaded in the scope of UIA - User Initiated Action. This means that a file upload must be started with a mouse click.
There are some of free file uploaders built in flash available. The only problem is that the queuing is broken by FP10. Adding the files to the pending uploads list is no problem. Starting the upload is no problem either. But when one file upload is done and the next should begin, Flash Player will not allow it if you don't click again which is pretty much useless.
There at least two requirements:
Applet file uploader These are available, e.g.: http://sourceforge.net/projects/jupload/
Widget to configure destination This is unusual in my experience, but I wrote one once for a Swing app which would be similar for an applet. It was necessary to provide the user a view of the remote file system, enable manipulation of the view, and then upload the changes. Note that there are transactions issues here, so it's not trivial.