Upload directory

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Upload directory

Nafise
Hi,

I've used upload controller; it places uploaded files in tomcat temp directory and obviously After tomcat shut down, temp directory would be cleaned. How can I change upload directory to another local directory or ftp address?

Thanks,
NAfise
Reply | Threaded
Open this post in threaded view
|

Re: Upload directory

Alessandro Vernet
Administrator
Nafise,

Nafise wrote
I've used upload controller; it places uploaded files in tomcat temp directory and obviously After tomcat shut down, temp directory would be cleaned. How can I change upload directory to another local directory or ftp address?
The idea is that temporary files are removed when the session for the user that uploaded the file expires. It is assumed that your application will copy those files to a more permanent directory or save them in a database, for instance when the user "saves" the form. If you don't, even if the files were not deleted, you would be left with a number of "random" temporary files in a directory that are not tied to any specific user.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Upload directory

Nafise
thank you Alex, I'm going to save uploaded image files as base64Binary.



Alessandro Vernet wrote
Nafise,

Nafise wrote
I've used upload controller; it places uploaded files in tomcat temp directory and obviously After tomcat shut down, temp directory would be cleaned. How can I change upload directory to another local directory or ftp address?
The idea is that temporary files are removed when the session for the user that uploaded the file expires. It is assumed that your application will copy those files to a more permanent directory or save them in a database, for instance when the user "saves" the form. If you don't, even if the files were not deleted, you would be left with a number of "random" temporary files in a directory that are not tied to any specific user.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Upload directory

Nafise
 Now, I'm using the eXist database to store uploaded images as base64Binary. It seems to work properly.
 However, I don't know how to present the uploaded images. At the time of using temporary directories I had written below line in my xhtml to show the image:

 <xforms:output ref="logo" mediatype="image/*" /> (the logo contained the address of temporary file)

 and it was ok .

 now, using base64Binary type, the above output is not working and All I can see is an empty border.

 then, how could I display an image which has been stored as a base64Binary?

 Thank you,
 Nafise





Nafise wrote
thank you Alex, I'm going to save uploaded image files as base64Binary.



Alessandro Vernet wrote
Nafise,

Nafise wrote
I've used upload controller; it places uploaded files in tomcat temp directory and obviously After tomcat shut down, temp directory would be cleaned. How can I change upload directory to another local directory or ftp address?
The idea is that temporary files are removed when the session for the user that uploaded the file expires. It is assumed that your application will copy those files to a more permanent directory or save them in a database, for instance when the user "saves" the form. If you don't, even if the files were not deleted, you would be left with a number of "random" temporary files in a directory that are not tied to any specific user.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Upload directory

Alessandro Vernet
Administrator
On Jan 18, 2008 10:01 AM, Nafise <[hidden email]> wrote:
>  Now, I'm using the eXist database to store uploaded images as base64Binary.
> It seems to work properly.

Great.

>  However, I don't know how to present the uploaded images. At the time of
> using temporary directories I had written below line in my xhtml to show the
> image:
>
>  <xforms:output ref="logo" mediatype="image/*" /> (the logo contained the
> address of temporary file)
>
>  and it was ok .
>
>  now, using base64Binary type, the above output is not working and All I can
> see is an empty border.
It's going to be a little more complicated in this case. Your element
"logo" contains some base64, right? Then you will need to serialize it
to a temporary file (you can use for this the new improvements to the
file serializer; see:
http://www.nabble.com/New-feature%3A-Support-for-temporary-files-in-File-serializer-to14768186.html)
when you load the XML from eXist. Then you're in the same case as you
were before.

But note that the URL to the temporary file may work locally, but
won't work if someone is accessing your server remotely. In that case
you will need to change that with a URL that points back to your
server and serves that temporary file.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Upload directory

Nafise
Alex,

Thenk you very much for the explanation.

Actually, I switched to save base64Binary in order not to encounter to the temporary files problem, but it seems that it just makes things more complicated.

I've reviewed almost all messeges about upload in forum, but still can't figure out what's the practical solution.

Briefly, I want to make a form in which each user could upload various files such as image and doc; considering below issues:
        = the files should be representable on page
        = they should be downloadable
        = they have to be permanent

I think it's a very common problem and even worths adding an extra sample in orbeon examples ;)
Has anybody had a similar problem? any practical experience? so please SOS.

Thanks in advance.
NAfise



Alessandro Vernet wrote
On Jan 18, 2008 10:01 AM, Nafise <n_dianatizadeh@yahoo.com> wrote:
>  Now, I'm using the eXist database to store uploaded images as base64Binary.
> It seems to work properly.

Great.

>  However, I don't know how to present the uploaded images. At the time of
> using temporary directories I had written below line in my xhtml to show the
> image:
>
>  <xforms:output ref="logo" mediatype="image/*" /> (the logo contained the
> address of temporary file)
>
>  and it was ok .
>
>  now, using base64Binary type, the above output is not working and All I can
> see is an empty border.

It's going to be a little more complicated in this case. Your element
"logo" contains some base64, right? Then you will need to serialize it
to a temporary file (you can use for this the new improvements to the
file serializer; see:
http://www.nabble.com/New-feature%3A-Support-for-temporary-files-in-File-serializer-to14768186.html)
when you load the XML from eXist. Then you're in the same case as you
were before.

But note that the URL to the temporary file may work locally, but
won't work if someone is accessing your server remotely. In that case
you will need to change that with a URL that points back to your
server and serves that temporary file.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws


-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/
Reply | Threaded
Open this post in threaded view
|

Re: Upload directory

Alessandro Vernet
Administrator
Nafise,

On Jan 20, 2008 4:53 AM, Nafise <[hidden email]> wrote:
> I've reviewed all messeges about upload in forum, but still can't figure out
> what's the practical solution.

The best I can offer is the scheme I wrote about in my previous
message in this thread.

In the future, you could conceive that the <xforms:output> could do
all of this for you. I.e. generating an ID for a given base64 encode
image, including in the page a URL that points to a service passing
that ID, providing the service that serves the image based on the ID
and corresponding base64 image. We don't see a pressing need on our
side for this feature, so this will come if someone implements it and
contributes the code or if some one sponsors this work.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Upload directory

masjab-2
In reply to this post by Nafise
I have the same problem!!!
Did you solve it?


Nafise wrote
Hi,

I've used upload controller; it places uploaded files in tomcat temp directory and obviously After tomcat shut down, temp directory would be cleaned. How can I change upload directory to another local directory or ftp address?

Thanks,
NAfise