| View previous topic :: View next topic |
| Author |
Message |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Sun Aug 28, 2005 3:56 am Post subject: CGI and parameter passing via URL ? |
|
|
I'm trying to use VDSIPP and the INTERNET HTTP,POST,<http client>,<url>,<string/filename> command. This is the full HTML code for the page in question:
| Code: | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>File Manager</TITLE>
<link REL="stylesheet" TYPE="text/css" HREF="/icetv.css">
<script type="text/javascript">
function checkAll(){
for (var i=0;i<document.fileList.elements.length;i++)
{
var e=document.fileList.elements[i];
if ((e.name != 'allbox') && (e.type == 'checkbox'))
{
e.checked=document.fileList.allbox.checked;
}
}
}
</script>
</HEAD>
<BODY>
<a href='/'><img src='/images/ICE_logo.gif' alt='ICE logo' border='0' /><br />Back to Main Menu</a> <br /> <hr noshade='noshade' size='1' /> <br />
<H1>File Manager</H1>
<p class="msg"></p>
<h3><b>NOTE:</b> File transfers are limited to a maximum file size of 2,097,152 bytes.</h3>
<table>
<tr>
<td>
<form action="/cgi-bin/filemanager.cgi" method="post" enctype="multipart/form-data">
<br>
<INPUT TYPE=hidden NAME="path" VALUE="\EPGtest">
<INPUT TYPE=hidden NAME="op" VALUE="addFile">
<INPUT TYPE=file NAME="fileName" SIZE=20 MAXLENGTH=100>
<INPUT TYPE=submit VALUE="Upload File">
</form>
</td>
</tr>
<tr>
<td>
<form action="/cgi-bin/filemanager.cgi" method="post">
<br>
<INPUT TYPE=hidden NAME="path" VALUE="\EPGtest">
<INPUT TYPE=hidden NAME="op" VALUE="addDir">
<INPUT TYPE=text NAME="dirName" SIZE=20 MAXLENGTH=100>
<INPUT TYPE=submit VALUE="Create Directory">
</form>
</td>
</tr>
<tr>
<td>
<form action="/cgi-bin/filemanager.cgi" method="post">
<br>
<INPUT TYPE=hidden NAME="path" VALUE="\EPGtest">
<INPUT TYPE=hidden NAME="op" VALUE="list">
<INPUT TYPE=submit VALUE="Refresh">
</form>
</td>
</tr>
</table>
<form name="fileList" action="/cgi-bin/filemanager.cgi" method="post" onSubmit='return confirm("WARNING: Are you sure you want to delete these files?")'>
<table border=0 cellspacing=1 cellpadding=3>
<tr>
<td colspan="4"><b><a href="/cgi-bin/filemanager.cgi?op=list&path=">\</a> EPGtest</b></td>
</tr>
<tr>
<td colspan="3"><input type="checkbox" value="on" name="allbox" onclick="checkAll();">Check/Uncheck All</td>
<td><INPUT TYPE=submit VALUE="Delete Selected"></td>
</tr>
</table>
<table bgcolor="black" border=0 cellspacing=0 cellpadding=0>
<tr>
<td>
<table border=0 cellspacing=1 cellpadding=3>
<tr>
<th></th>
<th>Name</th>
<th>Size (bytes)</th>
<th>Date</th>
</tr>
<tr class="rowdata">
<td> </td><td><a href="/cgi-bin/filemanager.cgi?op=list&path=\">..</a></td><td> </td><td> </td>
</tr>
<tr class="rowdata">
<td><input type=checkbox name="FILE" value="\EPGtest\20050827.tgd"></td><td><a href="/cgi-bin/filemanager.cgi?op=getFile&path=\EPGtest&file=20050827.tgd&size=38470">20050827.tgd</a></td><td align=right>38,470</td><td>Sat Aug 27 20:56:51 2005</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<INPUT TYPE=hidden NAME="path" VALUE="\EPGtest">
<INPUT TYPE=hidden NAME="op" VALUE="del">
</form>
</BODY>
</HTML>
|
In particular, it's the first FORM 'statement' (about line 30) that I'm interested in. I have tried: | Code: | | internet http,post,1,http://192.168.0.2/cgi-bin/filemanager.cgi,?op=addfile&path=\DestinationFolder&fileNameC:\Program%20Files\Data\myfile.txt | but it hasn't worked.
Any help would be greatly appreciated.
Cheers. _________________ John Trappett |
|
| Back to top |
|
 |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Thu Mar 20, 2008 6:20 pm Post subject: |
|
|
I need help with this same question. _________________ Joe Floyd |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Thu Mar 20, 2008 10:26 pm Post subject: |
|
|
I also had the same problem and one solution was to use curl.exe. The cgi page I was posting to was named filemanager.cgi and curl required an @ at the start of the filename. BTW it was the exact same cgi page as in trapper's post above.
| Code: | runh curl.exe -F op=addFile -F path=@chr(34)%%Path@chr(34) -F fileName="@"@chr(34)%%File@chr(34) http://%%IP/cgi-bin/filemanager.cgi,wait
%%Code = @retcode()
|
But getting back to vdsipp, the following works for me (to the same cgi page as above). The url needs to be the full cgi url/command-string/file. %%Path, %%Name and %%Ext are the destination path, filename and extension. %%File is the source file.
| Code: | # INTERNET HTTP,POST,<http client>,<url>,<string/filename>
INTERNET HTTP,POST,1,http://%%IP/cgi-bin/filemanager.cgi?op=addFile&path=\%%Path&file=%%Name.%%Ext,%%File
|
If you only need to post a string and not an actual file just leave off the %%File at the end. _________________ cheers
Dave
Last edited by DaveR on Thu Mar 20, 2008 10:42 pm; edited 2 times in total |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Thu Mar 20, 2008 10:40 pm Post subject: |
|
|
To make it a little clearer, the difference between trapper's non-working example and what works is the position of the last comma.
Does not work:
internet http,post,1,http://192.168.0.2/cgi-bin/filemanager.cgi,?op=addfile&path=\DestinationFolder&fileNameC:\Program%20Files\Data\myfile.txt
Works:
internet http,post,1,http://192.168.0.2/cgi-bin/filemanager.cgi?op=addfile&path=\DestinationFolder&fileNameC:\Program%20Files\Data\myfile.txt,%%LocalFileToBePosted
So the <url> in the help file example:
INTERNET HTTP,POST,<http client>,<url>,<string/filename> command
needs to be the full cgi url including commands and destination paths, files etc. The <string/filename> needs to be the local file or string that you are posting to the cgi page. I'm not sure about 'command' as I've never needed to use it. _________________ cheers
Dave |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|