in reply to Upload file (PDB format ) on server

In addition to the advice you have already been given, saying 'it doesnot run on server' isn't very helpful. Can you tell us more information, such as:

  • Do you receive an error message when running your script?
  • Does your web servers error log show any problems?
  • What Operating system and web server application are you using?
  • Also see How do I post a question effectively?.

    Martin

    • Comment on Re: Upload file (PDB format ) on server

    Replies are listed 'Best First'.
    Re^2: Upload file (PDB format ) on server
    by flyPerl (Initiate) on May 28, 2009 at 09:40 UTC
      thnx for the reply.

      No i dint get any message

      my code of the called file is

      print "Content-type: text/html\n\n";

      $_="My Page";
      $datalen=$ENV{'Content_Length'};
      read(STDIN,$q,$datalen);
      @data=split(/&/,$q);
      $len=@data;
      for($i=0; $i<$len; $i++)
      {
      $data=@data$i;
      $data=~ s/\s|t=|RUN//g;
      @data$i=$data;
      }
      $a1=(@data[0]);

      $a1 gets the file path,like C:Projecct\jeisika\mol.pdb
      which i plan to open and analyze, whereas, when made to run on server this file path comes to perl file as "mol.pdb" only!
      This is the first problem

      and the second is that i dont know whether i have to upload this file to server before running. Cannot it be done by browsing the file path and then POST it to the second pearl file where this file should be opened and analysed??

      I hope im clear now..... :)
        $a1 gets the file path,like C:Projecct\jeisika\mol.pdb
        which i plan to open and analyze, whereas, when made to run on server this file path comes to perl file as "mol.pdb" only!

        Why do you need the entire path to the file?  On the remote machine you have a different file system, where that path will most likely not be valid anyway...  Most browsers (except some versions of IE) are aware of this, and simply strip the directory component of the local path — in part because it may unnecessarily disclose private details of your local machine.

        If you want to analyse the contents of the file, there is no way around uploading those contents to the server, as the server cannot access C:Projecct\jeisika\mol.pdb on your local filesystem.  Read what the Anonymous Monk pointed to on how to upload files via CGI.

        $datalen=$ENV{'Content_Length'}; read(STDIN,$q,$datalen); @data=split(/&/,$q);

        I guess you would save yourself a lot of pain if you used CGI instead, which parses CGI parameters and handles uploading of files for you.

          thnx Carion....
          I suppose Im still not clear about my problem: Here's know the details
          ---------------------
          I want to read a file in PDB format from client by this code by using "POST"
          index.pl goes like this and calls results.pl

          <form action=results.pl method=post>
          <input name=t type=file />
          <input type=submit name=t
          value=Run />

          Now the file whose path is passed to results.pl by the form above, is to be opened and analysed on server.
          What to include in index.pl to open the file from client on the server?