Click to See Complete Forum and Search --> : Parsing uploaded files


ambercelery
March 20th, 2005, 03:42 PM
I'm wanting to upload some files to my web server - and on receiving the files, parse them automatically.
Can anyone give me some pointers or links to web sites that could help me do this?
i.e. how to run a script to parse the newly uploaded file.

any information will be a great help.
Thanks

khp
March 21st, 2005, 12:46 AM
Perhaps it would be usefull if you stated what language/environment you were looking to do this in.

ambercelery
March 21st, 2005, 02:06 AM
Well I was just after some guidelines as to how it could be done ? i.e. in what languages, using what tools etc.
I guess for me a simple Perl script would be easiest

khp
March 21st, 2005, 04:03 PM
With the amount of details you have provided the only answer I can possible give you is

http://www.google.com/search?q=parsing+perl

ambercelery
March 22nd, 2005, 12:29 AM
Sorry, I've not explained what i want very well. I do not want help with writing a parser in Perl. I know how to do this.
What i would like is some information on how I get my script to run - i.e. I will be uploading some files from my PC to my web server. On receipt of the incoming file, I want the script to run - in order to parse the incoming file.

I do not know how i can do this. Any ideas?

khp
March 22nd, 2005, 01:14 AM
At this point all I can really do is repeat what I said in my first post.

Ie. what environment are you looking to do this in ?.

More specific questions come to mind, like what kind of server are you uploading to. And do you upload via the http server, or via ftp or something else ?
And what kind of access do you have to the server, and are you allowed to run your own CGI scripts on the server, and if so in what languages, asp, php, jsp, perl ?

ambercelery
March 22nd, 2005, 11:05 AM
I have web space provided by http://www.krystalhosting.co.uk/
i can have my own CGI scripts running.
I am planning on ftp'ing files to my webspace - so would like the script to recognise a newly ftp'd file and parse it.
The server doesnt support ASP.
I will be running a Visual C++ program (on windows) which will periodically upload files to the ftp server.

khp
March 22nd, 2005, 01:48 PM
To the best of my knowlege there is no way to trigger a script by a FTP upload. And since you probably don't have much control over the ftp server configuration this is probably a moot point.

There are multiple other ways you might launch your script, you could setup a cron job on the server to check for any newly uploaded files which could the run the parser, cron jobs can be scheduled to run as often as once a minute.
according to this page http://www.krystalhosting.co.uk/hosting.php you should be able to setup cron jobs on the server

The alternative would be to use a script on the client side, to upload the files, and have that script do a http request to a CGI script on the server side.

ambercelery
March 22nd, 2005, 02:24 PM
Excellent.
Thanks for the information and sorry for the lack of clarity in my previous posts.

ambercelery
March 23rd, 2005, 04:30 AM
Thanks for the help with my parsing files questions.

As i mentioned in the posted message, I am trying to ftp some files to the server and get them parsed once they have been uploaded - but you have told me that this isnt possible.

I have never used HTTP Post but would i be able to use this rather than FTP'ing the files to the server - in order to get the information parsed straight away.

The data that i am trying to send is only approximately 400 Bytes - and therefore doesnt need to be done in an ftp'd file.

Any help would be greatly appreciated?

khp
March 23rd, 2005, 06:14 AM
I have never used HTTP Post but would i be able to use this rather than FTP'ing the files to the server - in order to get the information parsed straight away.


Sure this is quite doable.

This tutorial walks you through setting up a perl cgi script for file upload.
Should be pretty easy to modify it to run your parser when the upload is done.

http://www.sitepoint.com/article/uploading-files-cgi-perl