Cheers,
Maria
Cheers,
Maria
Server or Client maria?
Try with a JSP.
IT2Be:
Server or Client maria?
On the server. Copy a document from client machine to server.
Roberto Blasco:
Try with a JSP.
Sorry, what’s JSP?
maria:
:?:Cheers,
Maria
There’s a couple of options nowadays. Could be in memory, on a hard drive, a USB stick or even an old fashioned floppy drive. One could even print a file to store it but that’s probably the least efficient.
Maria what is really your question?
Jan Aleman:
There’s a couple of options nowadays. Could be in memory, on a hard drive, a USB stick or even an old fashioned floppy drive. One could even print a file to store it but that’s probably the least efficient.Maria what is really your question?
Scenario: the user wishes to upload a document from their local client machine to the server. They want to actually store the document (text, pdf, picture, etc) on the server’s hard drive and store the link to its location in the database.
Hope this explains the problem better…
there are some options:
Sorry, what’s JSP?
This’s an example how to use a JSP to upload any file to a Tomcat server (like Servoy server).
What you need are this files:
commons-fileupload-1.2.1.jar (Apache lib to manage file uploads)
commons-httpclient.jar (Apache lib to manage http protocol)
upload.jsp (The JSP that process the file to be upload)
How this example works…
1.- Create the folders
upload
resources
in /servoy/application_server/server/webapps/ROOT, so yo will find
/servoy/application_server/server/webapps/ROOT/upload
/servoy/application_server/server/webapps/ROOT/resources
You can change the name of this folders at your own, always inside ./ROOT. If changed, don’t forget to do it too into the JSP code and the Servoy Solution.
2.- Inside /servoy/application_server/server/webapps/ROOT/resources, we will put the file upload.jsp
3.- Inside /servoy/application_server/server/lib, we will put the files
commons-fileupload-1.2.1.jar
commons-httpclient.jar
Remember to restart ther server to let it engage the libs.
Best regards. Roberto.
commons-httpclient.jar (273 KB)
commons-fileupload-1.0.jar (21.9 KB)
JSPUpload.servoy (4.46 KB)
Harjo:
there are some options:
- you can use the (free) tools plugin of It2Be that has some (minimal) functions for that.
- or use the Usermanager plugin, that has now also a complete (serverside) file-plugin with file-streaming.(client<->server)
- or use the streaming plugin of IT2BE
Another option would be to have a blob field in form in servoy through which the user uploads. This results in a blob in the database. Then write that blob out to disk, either by calling a webclient that has logic to do this or using a batch processor.
Or use one of the many free FTP plugins…
(does require an ftp server of course)
options, options, options! Servoy has TOO many options!
is that all?
isnt there one option more?
Bring it on Johan! Tell us already!
i dont know!
This was not something that is coming, because we have already great plugins for this from our great plugin developers!
but what options do we have left.
streaming over rmi (server plugin)
streaming over http (jsp page)
streaming through a record (also over rmi)
I would say we need a “Beam me up (to remote server)”!
That would be really cool!
By the way, with the rmi options the good think currently is that it is compressed now so if it the bytes can be compressed it is the fastest way.
Hi,
One more option ( that we are using ) :
A stored procedure in the ( Oracle ) database.
Regards,
Hans
Hi Hans,
Hans Nieuwenhuis:
A stored procedure in the ( Oracle ) database.
Can you elaborate on this ?
You store the file in the database and then trigger a stored procedure that writes it to the filesystem ?
Hi Robert,
We use this in several ways, for instance to create tab-delimited files.
We use two Oracle features combined.
sql> create directory sampledir as ‘x:\outputdir’;
sql> grant read,write on directory sampledir to sampleoracleuser;
This way the directory is “out of sight” for the enduser
outfile := utl_file.fopen(‘sampledir’,samplefile,‘W’,32767)
Regards,
Hans
but what options do we have left.
streaming over rmi (server plugin)
streaming over http (jsp page)
streaming through a record (also over rmi)
Streaming over RMI already exists! That is what the UserManager plugin does. Also, streaming “through a record” is also done by the plugin (although not the record is streamed, but provided, queried and updated on the server). As you said
we have already great plugins for this from our great plugin developers!