# How to upload file?

**URL:** <https://techcommunity.softwareag.com/t/how-to-upload-file/61497>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Web-and-XML-Technology\
**Created:** [September 25, 2006, 12:39pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497 "2006-09-25T12:39:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 25, 2006, 12:39pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/1 "2006-09-25T12:39:20Z")

</div>

i wish to upload file to web server for further processing. how do i do it in natural? i have included a sample asp file for reference. pls help.

thanks in advance.

[color=“blue”]

### File Upload
 File: [/color]

---

<div class="post-metadata">

**Author:** ![Eric\_Schindler](https://avatars.discourse-cdn.com/v4/letter/e/bbe5ce/32.png) [@Eric\_Schindler](https://techcommunity.softwareag.com/u/Eric_Schindler)\
**Post date:** [September 25, 2006, 1:32pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/2 "2006-09-25T13:32:41Z")

</div>

😢 Works not with SYSWEB, because SYSWEB can only transfer alphanumeric data and will  
block CONTENT-TYPES like ‘multipart/form-data’.

:lol: Works with SYSWEB3.  
You can find a delivered example at the SYSWEB3 Libray:  
E3MULTIP.

Don’t forget to install the new Web Interface version with  
nww3\* programs at your http server side, a  
different RPC/DCOM server with steplib to SYSWEB3 and  
then run the program from your browser.

Note:  
The program does NOT show to seperate the different “multipart” sections.

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 25, 2006, 3:39pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/3 "2006-09-25T15:39:57Z")

</div>

thanks for info. need to research. will let u know of result.

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 26, 2006, 9:16am UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/4 "2006-09-26T09:16:14Z")

</div>

eric, i have a problem when migrating my programs from SYSWEB to SYSWEB3. I have followed the migration steps mentioned in Natural documentation. Programs that can be run previously in SYSWEB now can’t run anymore, and it generates this error:

“The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:”

What could be the reason? Thanks in advance!

joel

---

<div class="post-metadata">

**Author:** ![Eric\_Schindler](https://avatars.discourse-cdn.com/v4/letter/e/bbe5ce/32.png) [@Eric\_Schindler](https://techcommunity.softwareag.com/u/Eric_Schindler)\
**Post date:** [September 26, 2006, 12:46pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/5 "2006-09-26T12:46:48Z")

</div>

To migrate your programs it is only necessary to recatalog with steplib SYSWEB3 instead of SYSWEB (can be reversed, if you don’t use new features).

Then you have to call e.g. nww3cgi.exe or nww3dcgi.exe otherwise you get a parameter problem.

You need to change your RPC server (don’t forget security if used) that there is a steplib to SYSWEB3 not to SYSWEB and not to both.

If you use DCOM don’t forget to register your class SYSWEB3 and to change the parameter module used for the DCOM server.

Check a delivered program from SYSWEB3, e.g. NAT-ENV, to check that your installation works in a correct way.

If you run //nww3cgi.exe/SYSWEB3/NAT-DIR?LIB=, there is a new functionality, where your can see what interface your program is cataloged with.

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 26, 2006, 1:05pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/6 "2006-09-26T13:05:40Z")

</div>

thanks for the fast reply. here is what i have done:

1. recatalog with steplib SYSWEB3 instead of SYSWEB  
yes. i have removed SYSWEB from steplib in NATPARM and included SYSWEB3

2. you have to call e.g. nww3cgi.exe or nww3dcgi.exe  
yes. i have changed from nwwdcgi.exe to nww3dcgi.exe respectively

3. If you use DCOM don’t forget to register your class SYSWEB3 and to change the parameter module used for the DCOM server  
yes. i have registered my class SYSWEB3. how to change parameter module? is it related to “nww3dmod.ini” or “nww3dmod2.ini”?

4. Check a delivered program from SYSWEB3, e.g. NAT-ENV  
below is the result:  
[color=“green”]Environment Variables  
Name Value Length From  
PATH\_INFO SYSWEB3/NAT-ENV 15 Server  
NATWEB\_VERSION 06.02.01 WEB-ONL 16 Server  
NATWEB\_LOGTIME Tue, 26 Sep 2006 14:30:24 GMT 29 Server  
NWW\_INOUT\_LENGTH (A) DYNAMIC 11 Server  
SCRIPT\_NAME Test/Utility3/ 14 Server  
GATEWAY\_INTERFACE HTM-ONL/GUI/06.02.01 20 Server  
REMOTE\_HOST localhost 9 Server  
REMOTE\_ADDR 127.0.0.0 9 Server  
SERVER\_SOFTWARE Natural Test Utility 20 Server  
HTTP\_USER\_AGENT Natural 7 Server  
SERVER\_NAME localhost 9 Server  
SERVER\_PORT 80 2 Server  
NWW\_USER\_ID JOEL HWA 8 Server  
DCOM\_SERVER\_NAME (local dynamic) 15 Server  
REQUEST\_METHOD GET 3 Server

NAT-ENV - Tue, 26 Sep 2006 14:30:24 GMT 15 variables Natural [/color]

1. If you run //nww3cgi.exe/SYSWEB3/NAT-DIR?LIB=, there is a new functionality, where your can see what interface your program is cataloged with.  
I dont understand this statement.

Looking forward to your reply soon. Thanks.

-joel

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 26, 2006, 1:13pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/7 "2006-09-26T13:13:07Z")

</div>

ok eric. i understand te last statement. hehe…it’s a cool utility!!!

unfortunately, it still gives the CGI Error. ☹

---

<div class="post-metadata">

**Author:** ![Eric\_Schindler](https://avatars.discourse-cdn.com/v4/letter/e/bbe5ce/32.png) [@Eric\_Schindler](https://techcommunity.softwareag.com/u/Eric_Schindler)\
**Post date:** [September 26, 2006, 1:24pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/8 "2006-09-26T13:24:40Z")

</div>

> [@](#):
>
> how to change parameter module? is it related to “nww3dmod.ini” or “nww3dmod2.ini”?

You did already what you needed. nww3dmod2.ini is if you use Apache modules instead of cgi.

Question:  
Did you previous run your DCOM Server with NAT61?  
If that’s the case, you have to unregister your class and then register your class again with your NAT62 environment.  
 → during registration the path to the DCOM server (in this case Natrural) is saved at the registry.

> [@](#):
>
> …understand te last statement. hehe…it’s a cool utility!!!

Hint:  
Did you ever run NAT-DOCU - there you can see more useful NAT-\* utilities …

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 26, 2006, 1:27pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/9 "2006-09-26T13:27:38Z")

</div>

hmmm…eric…currently i’m using NAT6.1 :shock:

already requested from SAG for Nat6.2 but the cds have not arrived.

so how to solve my problem? :lol:

i will try the NAT-DOCU. Thanks

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 26, 2006, 1:31pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/10 "2006-09-26T13:31:58Z")

</div>

eric sorry sorry!

just checked again. i’m currently using NAT6.2.1 and not NAT6.1 now waiting for Nat6.2.2 :oops:

i have tried that option also. unregister,delete class and LWEB, and then generate a new class again after i have cataloged the whole library.

need advice…

---

<div class="post-metadata">

**Author:** ![Eric\_Schindler](https://avatars.discourse-cdn.com/v4/letter/e/bbe5ce/32.png) [@Eric\_Schindler](https://techcommunity.softwareag.com/u/Eric_Schindler)\
**Post date:** [September 26, 2006, 1:32pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/11 "2006-09-26T13:32:37Z")

</div>

:idea: DCOM Server …

… for SYSWEB3 you need a ‘different’ class with different internal interfaced - I forgot :roll:  
… unregister your user defined class  
… delete you user defined class for your library. Don’t forget do delete the spcific LDA for this library.  
… run the Web Interface Plugin and generate a “new” class and lda for your Library.  
… register your class  
… and try again

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 26, 2006, 1:43pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/12 "2006-09-26T13:43:48Z")

</div>

I have tried that eric, i unregister,delete both the class and LWEB, then i regen again using the Web Interface Plugin, before i post my question.

the only thing i din try before your first advice was to register SYSWEB3 class. :lol:

---

<div class="post-metadata">

**Author:** ![Eric\_Schindler](https://avatars.discourse-cdn.com/v4/letter/e/bbe5ce/32.png) [@Eric\_Schindler](https://techcommunity.softwareag.com/u/Eric_Schindler)\
**Post date:** [September 26, 2006, 1:45pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/13 "2006-09-26T13:45:51Z")

</div>

What http server do you use?  
The examples (e3\*) form SYSWEB3 work?  
Did you try a new generated program from the Web Interface plug-in and run this successfully?  
Do you old programs call PERFORM W3CONTENT-TYPE ?

---

<div class="post-metadata">

**Author:** ![Eric\_Schindler](https://avatars.discourse-cdn.com/v4/letter/e/bbe5ce/32.png) [@Eric\_Schindler](https://techcommunity.softwareag.com/u/Eric_Schindler)\
**Post date:** [September 26, 2006, 1:50pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/14 "2006-09-26T13:50:44Z")

</div>

How does the url you call from the browser look like?  
… calling SYSWEB3 subprograms  
… calling your own subprograms  
because your tried NAT-ENV from WEB-ONL3, not from your browser:  
SCRIPT\_NAME: Test/Utility3/  
GATEWAY\_INTERFACE: HTM-ONL/GUI/06.02.01

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 26, 2006, 6:44pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/15 "2006-09-26T18:44:28Z")

</div>

> [@Eric Schindler](#):
>
> What http server do you use?  
> IIS 5.1
> 
> The examples (e3\*) form SYSWEB3 work?  
> Yes.  
>    
> Did you try a new generated program from the Web Interface plug-in and run this successfully?  
> Yes and it run successfully.
> 
> Do you old programs call PERFORM W3CONTENT-TYPE ?  
> Yes. Will it gives problems?

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 26, 2006, 6:46pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/16 "2006-09-26T18:46:39Z")

</div>

> [@Eric Schindler](#):
>
> How does the url you call from the browser look like?  
> … calling SYSWEB3 subprograms  
> [color=“blue”][http://localhost/cgi-bin/nww3dcgi.exe/SYSWEB3/E3ANCHOR[/color]](http://localhost/cgi-bin/nww3dcgi.exe/SYSWEB3/E3ANCHOR%5B/color%5D)
> 
> … calling your own subprograms  
> [color=“blue”][http://localhost/cgi-bin/nww3dcgi.exe/WEB/MENU[/color]](http://localhost/cgi-bin/nww3dcgi.exe/WEB/MENU%5B/color%5D)
> 
> because your tried NAT-ENV from WEB-ONL3, not from your browser:  
> SCRIPT\_NAME: Test/Utility3/  
> GATEWAY\_INTERFACE: HTM-ONL/GUI/06.02.01

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 26, 2006, 6:48pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/17 "2006-09-26T18:48:44Z")

</div>

Actually Eric, some of my subprograms are working and some are not. Based on my guess, below is part of my code that i think gives the error (i’m using a dispatcher program just exactly like in the sample):

[color=“green”]  
VALUE “MY PROFILE”  
PERFORM SR-2VUSR #PARM-WEB

VALUE “UPDATE”  
PERFORM READ-ENV  
CALLNAT “SP-GUSR” #USERID #USERNAME #PASSWORD #USERTYPE  
#COMPANYCODE #REPORT(\*)  
CALLNAT “SP-2SUSR” #USERID #PASSWORD #OLD-PASSWORD  
#NEW-PASSWORD1 #NEW-PASSWORD2#PARM-WEB.#MSG  
PERFORM SR-2VUSR #PARM-WEB[/color]

When i click on “My profile” which is a form button at menu page, i can get to the view page (SR-2VUSR). However, when i click on “Update” button at the view page, it will then generate the CGI Error. It seemed that[color=“red”] I can’t call back the same subroutine /color.

I don’t have this problem when my program was catalogued with SYSWEB. But since migrating to SYSWEB3, I have this recurring problem. Need to solve it fast cause i’m in a tight project deadline.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 27, 2006, 10:00am UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/18 "2006-09-27T10:00:06Z")

</div>

Eric, found out the root of the problem already, but unfortunately still no solution. This is the report generated after i have excluded W3INIT and W3END on purpose:

[color=“red”]The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

ID=4&USER-ID=5&USERNAME=&PASSWORD=&USER\_TYPE=Choose User Type:&TODO=Main Men[/color]

As you can see from the TODO paramater, the last byte of the string is truncated. Therefore, my dispatcher can’t match the string hence cause the error. If i change my dispatcher to accept “Main Men” then the application can work just fine.

Again, i wish to emphasize that i do not face this problem with SYSWEB. So need your advice.

-joel

---

<div class="post-metadata">

**Author:** ![Eric\_Schindler](https://avatars.discourse-cdn.com/v4/letter/e/bbe5ce/32.png) [@Eric\_Schindler](https://techcommunity.softwareag.com/u/Eric_Schindler)\
**Post date:** [September 27, 2006, 12:40pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/19 "2006-09-27T12:40:52Z")

</div>

Question:  
Did you get this string using again web-onl3 or from the browser?  
How does the calling page/link look like?

Call you call instead of your program NAT-DATA and see what data has been delivered from the HTTP server.

---

<div class="post-metadata">

**Author:** ![joelhwa](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@joelhwa](https://techcommunity.softwareag.com/u/joelhwa)\
**Post date:** [September 27, 2006, 1:12pm UTC](https://techcommunity.softwareag.com/t/how-to-upload-file/61497/20 "2006-09-27T13:12:44Z")

</div>

i call from my browser and NOT from web-onl3.

this is from edit new user page (SR-3NUSR)  
[http://localhost/cgi-bin/nww3dcgi.exe/WEB/SELECT?ID=4&TODO=New+User](http://localhost/cgi-bin/nww3dcgi.exe/WEB/SELECT?ID=4&TODO=New+User)

this is after i click “Save New User”  
[http://localhost/cgi-bin/nww3dcgi.exe/WEB/SELECT](http://localhost/cgi-bin/nww3dcgi.exe/WEB/SELECT)

then the error occur…this is the string if i exclude W3INIT and W3END:  
ID=4&USER-ID=5&USERNAME=a&PASSWORD=a&USER\_TYPE=C&COMPANY=STB&CBREPORT=1&TODO=Save New Use

again the last byte is truncated. that is the source of the problem. but i can’t seem to solve it.

btw, eric, does the character encoding affect the truncation of string???

[Next page](https://techcommunity.softwareag.com/t/how-to-upload-file/61497.md?page=2)
