CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Nov 2003
    Posts
    41

    Parsing uploaded files

    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

  2. #2
    Join Date
    May 2003
    Location
    Denmark
    Posts
    1,315

    Re: Parsing uploaded files

    Perhaps it would be usefull if you stated what language/environment you were looking to do this in.
    The biggest problem encountered while trying to design a system that was completely foolproof,
    was, that people tended to underestimate the ingenuity of complete fools.
    Douglas Adams

  3. #3
    Join Date
    Nov 2003
    Posts
    41

    Re: Parsing uploaded files

    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

  4. #4
    Join Date
    May 2003
    Location
    Denmark
    Posts
    1,315

    Re: Parsing uploaded files

    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
    The biggest problem encountered while trying to design a system that was completely foolproof,
    was, that people tended to underestimate the ingenuity of complete fools.
    Douglas Adams

  5. #5
    Join Date
    Nov 2003
    Posts
    41

    Re: Parsing uploaded files

    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?

  6. #6
    Join Date
    May 2003
    Location
    Denmark
    Posts
    1,315

    Re: Parsing uploaded files

    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 ?
    Last edited by khp; March 22nd, 2005 at 02:24 AM.
    The biggest problem encountered while trying to design a system that was completely foolproof,
    was, that people tended to underestimate the ingenuity of complete fools.
    Douglas Adams

  7. #7
    Join Date
    Nov 2003
    Posts
    41

    Re: Parsing uploaded files

    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.

  8. #8
    Join Date
    May 2003
    Location
    Denmark
    Posts
    1,315

    Re: Parsing uploaded files

    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.
    The biggest problem encountered while trying to design a system that was completely foolproof,
    was, that people tended to underestimate the ingenuity of complete fools.
    Douglas Adams

  9. #9
    Join Date
    Nov 2003
    Posts
    41

    Re: Parsing uploaded files

    Excellent.
    Thanks for the information and sorry for the lack of clarity in my previous posts.

  10. #10
    Join Date
    Nov 2003
    Posts
    41

    Re: Parsing uploaded files

    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?

  11. #11
    Join Date
    May 2003
    Location
    Denmark
    Posts
    1,315

    Re: Parsing uploaded files

    Quote Originally Posted by ambercelery
    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/upl...files-cgi-perl
    The biggest problem encountered while trying to design a system that was completely foolproof,
    was, that people tended to underestimate the ingenuity of complete fools.
    Douglas Adams

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured