Jump to content

Programatically move files


Recommended Posts

I'm generating html reports from field data and want the reports to be visible to other people in the work group.

 

I'm not a web developer, and I'm not sure that this is possible.

 

Here's what I've done so far:

HTML reports are programatically uploaded via ftp to a username/home/guest report section.

The main domain webpage has a link to where the reports should be moved to.

 

How do I:

Programatically move reports from username/home/guest to a location my web domain can link to as the reports come in?

Programatically create a webpage listing these reports (I believe a PERL script is the way to go on this, I'm just not sure how to invoke the script only when new ftp upload occur. I wrote the code uploading the HTML files so maybe somewhere in there I could call the PERL script?)

 

~Jon

Link to comment
Share on other sites

I'd really prefer not to use a content manager for this. I don't need something quite that complicated at this time.

 

I've been trying to execute a simple perl script, but have been receiving the 500 error. The script has 0755 permissions and the file contains the following:

-----

#/usr/bin/perl

 

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

 

print <<EOTF;

<html>

<head>

<title>hello, world</title>

<body>

<h1>hellow world</h1>

</body>

</html>

EOTF

------

the file is my "public_html/cgi-bin" folder.

filename is "helloworld.cgi"

 

I've successfully run this code on my machine, and I feel like I've read every tutorial online for this. Please help.

 

~Jon

 

Link to comment
Share on other sites

Use
#!/usr/bin/env perl

for the first line.

 

Didn't seem to help.

I now have:

#!/usr/bin/env perl

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

print <<EOTF;
<html>
<head>
<title>hello, world</title>
<body>
<h1>hellow world</h1>
</body>
</html>
EOTF

 

I've converted end of line to both unix [LF] and windows [CRLF] and that doesn't seem to be it either. Any other ideas?

 

Thanks again,

 

~Jon

 

Link to comment
Share on other sites

Guest Geoff

I'm not an expert at perl, but shouldn't

 

print <<EOTF;

 

be

 

print <<EOTF

 

What is the URL to your script?

Link to comment
Share on other sites

My URL:

 

http://fantasyfootballexpert.heliohost.org.../helloworld.cgi

 

one of the websites I used to help construct the code:

http://htmlfixit.com/cgi-tutes/tutorial_Pe...id_script.shtml

 

I have tested the output with ActivePerl. (it appears to be working properly.)

 

As far as the syntax goes, it doesn't look like a ";" is supposed to be there (obviously not a perl expert either but it does seem odd.)

 

~Jon

Link to comment
Share on other sites

This works for me:

 

#!/usr/bin/perl -w
use CGI qw(:standard);
print header; 

print <<EOF;
<html>
<head>
<title>hello, world</title>
</head>
<body>
<h1>hello world</h1>
</body>
</html>
EOF

 

Make sure your file permissions are 755.

 

 

If your still getting 500 errors with my code, check out this thread:

 

http://www.helionet.org/index/index.php?sh...ic=6787&hl=

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...