I need to develop a new application using Natural Web on Linux platform. My Web Server is Apache and I am using Natural 6.1, Tamino 4.2 and EntireX 721.
The application needs to have an option where the user can select any kind of files (mp3, word, excel, ppt, gif, wav…) on Web (Natural Web) and the file needs to be stored in Tamino.
As far as I know there is a possibility on Natural 6. The statement REQUEST DOCUMENT is able to handle these kind of files and to store in Tamino.
The problem is: How can I handle the files using Natural Web and REQUEST DOCUMENT?
If anyone has an idea how to use it, please, let me know. If you have an example that you can attach, I would thank you.
Your topic refers to many different issues.
Natural Web Interface is used to provide information to a browser.
REQUEST DOCUMENT is used to access an url (or uri). Several options are possible to use with this statement. For storing a file via an http server you must use the PUT option.
DEFINE DATA LOCAL
1 #DOCUMENT (A) DYNAMIC
1 #RESULTXML (A) DYNAMIC
1 #RC (I4)
END-DEFINE
#DOCUMENT := 'TEST TEST TEST'
REQUEST DOCUMENT FROM "http://pcmmr2/test.txt"
WITH
DATA ALL #DOCUMENT
RETURN
PAGE #RESULTXML
RESPONSE #RC
print #RESULTXML
END
To use the PUT option, your http server must be configured properly.
Accessing Tamino requires the url plus the query:
Yes, there are some different issues on this topic. Let me try to explain better.
I need to build a new application in Natural Web. Of course, Natural Web is an interface to provide Natural application to the worldwide using browser.
The application needs to request the file. To do it, the application needs to open a search file window in order to choose the file in the computer. (This is the part I don’t know how I can do – maybe it would be solved using Javascript or any ActiveX on Windows).
After chosen one (MP3, Word, Excel, Powerpoint, Wav,…) the application needs to store the file in Tamino (this part I know – it is exactly what you wrote).
I hope that this explanation could be better understood.
I did not find an API call to get a list of files in a directory
However I did find
:arrow: USR1054 to get a list of objects in a library and the NAT-WEB tool NAT-DIR using this API. (please refer to the NAT-WEB online docu: http:///cgi-bin/nwwdcgi.exe/sysweb/nat-docu)
:arrow: the tool NAT-RES from NAT-WEB as well to access a file in the resource directory.
:arrow: W3READ-RESOURCE to read a resource into a dynamic variable
:arrow: USR1052 to send a command to the operating system - can be useful to get a list of files to be selected from.
NAT-RES provides information on the handling of mime-types which might be useful as well.
With the current version of the Web Interface it is not possible to transfer files which contain binary data.
It is planed to add this functionality to the next version of Natural (NAT62) to handle binary data. Then a multipart-formdata upload to a Natural program will be possible and binary data can be send back via the Web Interface.