CGI_Lib and upload file,

Windows specific forum
jpd
Enthusiast
Enthusiast
Posts: 167
Joined: Fri May 21, 2004 3:31 pm

CGI_Lib and upload file,

Post by jpd »

Hi Forum,
I'm test at moment the CGI Lib Version 20060224 from Paul Leischow,
and have a little problem.

I'm use the jana server 2.0 and the upload-file example from helpfile

Code: Select all


result=CGI_FileIn("C:\Temp\") 

CGI_Header() 
If result 
 CGI_Out("File Received")  
 
 Else  
 
 CGI_Out("Failed to receive File")  
 
  
EndIf 

with this code is possible to put one file on a folder on the web server, but I'm

rescontered a error (probable in my configuration), if the file to upload bigger as 10K and if the file not a
text file then recieve a error message.

for example with exe files the upload return a error:

Content-type: application/octet-stream Failed to receive File.

on the log file of the server I can see this error:

Thu, 09.03.2006 18:22:08 : Cgi-Program did not send header-termination (\n\n). Cgi-Program: C:\Programme\Jana2\cgi-bin\CGIOrig.exe

the other error rescontred is the size of the file,

normaly this can changed with the optional paramerter:

Optional MaxPost specifies size of file allowed to receive. Default is 102400 bytes.
also:

Code: Select all

result=CGI_FileIn("C:\Temp\",10240000) 
but the same error appair.

any idea?

Thanks
JPD
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1285
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

You didn't post your HTML code that sends the file to the CGI.

If you are only able to receive TEXT files then maybe you forgot
enctype="multipart/form-data" in <Form> ??

Also, you can set the max upload size to as high as you want using the CGI_FileIn() command but if your server is not configured to accept that size... it won't work. ;)


I would recommend the very popular servers like Sambar or Apache
Image Image
jpd
Enthusiast
Enthusiast
Posts: 167
Joined: Fri May 21, 2004 3:31 pm

Post by jpd »

Hi Paul,

thanks very much for the rapide answear, SUPER!

here the HTML file...
I think is the same as the helpfile

Code: Select all

<html> 
<head> 
<title>CGI Test</title> 
</head> 

<body> 
<center> 

<font color="#0000aa" face="ARIAL" size="+1"> 
<b> 
<form method="post" action="/cgi-bin/CGIOrig.exe" enctype="multipart/form-data"> 
Select Test File 
<br> 
<input size="100" name="upfile" type="file"> 
<br><br><input value="Send File" type="submit"> 
</form> 
</b> 
</font> 

</center> 
</body> 
</html> 
I will ask in the jana forum if exist this configuration possibility,
I' dont have found out this possibility. :-(

Ciao

JPD
jpd
Enthusiast
Enthusiast
Posts: 167
Joined: Fri May 21, 2004 3:31 pm

Post by jpd »

Hi Paul,
with your reccomend product "Sambar"
I would recommend the very popular servers like Sambar or Apache
works fine without error :-) ,
Thanks!

the people on jana forum say that the server itself not have "affection"
on the dimension of the uploading file.

But I'm really interested to found-out the cause of this error situation.

Existing a methode to set the cgi_lib on debug modus?


Best
jpd
Pantcho!!
Enthusiast
Enthusiast
Posts: 538
Joined: Tue Feb 24, 2004 3:43 am
Location: Israel
Contact:

Post by Pantcho!! »

SAMBAR rocks! i use it as my webserver :D
Post Reply