Building Form with File upload

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

Building Form with File upload

Xavier MOGHRABI
Hi

I'd like to add in a form the possibility for users to upload file. My form
look like this one :

<form action="" enctype="mutipart/form-data" method="post">
<input type="text" name="submitter" />
<input type="file" name="file" />
<input type="submit" />
</form>

The problem I have is with xWiki to get the data from the $request object and
handle them by using Velocity. After I'd like to store the uploaded file as
attachment in a document.

If someone of yours have already done that I'm interesting in getting a such
example.

By the way, I've noticed that there is a plugin called FileUpload in XWiki. I
think it would be great to use it because uploaded file handling is not
really handy, but I don't know how to use it within the wiki.

Thanks.

--
Xavier MOGHRABI - Consortium ObjectWeb
Email: xavier.moghrabi at objectweb.org


--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Building Form with File upload

Ludovic Dubost

Hi Xavier,

I suspect you have a mispell in your 'enctype'

I've uploaded sample code to xwiki.org which only works on the SVN
version of XWiki which has the fileupload plugin.

http://www.xwiki.org/xwiki/bin/view/Snipplets/File+Upload?xpage=code

Ludovic

Xavier MOGHRABI wrote:

> Hi
>
> I'd like to add in a form the possibility for users to upload file. My form
> look like this one :
>
> <form action="" enctype="mutipart/form-data" method="post">
> <input type="text" name="submitter" />
> <input type="file" name="file" />
> <input type="submit" />
> </form>
>
> The problem I have is with xWiki to get the data from the $request object and
> handle them by using Velocity. After I'd like to store the uploaded file as
> attachment in a document.
>
> If someone of yours have already done that I'm interesting in getting a such
> example.
>
> By the way, I've noticed that there is a plugin called FileUpload in XWiki. I
> think it would be great to use it because uploaded file handling is not
> really handy, but I don't know how to use it within the wiki.
>
> Thanks.
>
>  
> ------------------------------------------------------------------------
>
>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  

--
Ludovic Dubost
XPertNet: http://www.xpertnet.fr/
Blog: http://www.ludovic.org/blog/
XWiki: http://www.xwiki.com
Skype: ldubost AIM: nvludo Yahoo: ludovic




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Building Form with File upload

Xavier MOGHRABI
hi Ludo,

Yes, I've misspelt the 'enctype'.

Anyway, in your example, it seems that it doesn't work well since it doesn't
display information when I upload my file. Is the problem coming from the
fact that I don't have the right to upload ?

If I understand well this example, to upload a file I should use 'file' as the
param of the 'name' such as :
<input type="file" name="file" />

Regards

Le Jeudi 27 Octobre 2005 11:23, Ludovic Dubost a écrit :

> Hi Xavier,
>
> I suspect you have a mispell in your 'enctype'
>
> I've uploaded sample code to xwiki.org which only works on the SVN
> version of XWiki which has the fileupload plugin.
>
> http://www.xwiki.org/xwiki/bin/view/Snipplets/File+Upload?xpage=code
>
> Ludovic
--
Xavier MOGHRABI - Consortium ObjectWeb
Email: xavier.moghrabi at objectweb.org
Phone: +33 4 76 61 52 35



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Building Form with File upload

Ludovic Dubost

XWiki.org is running an older version of XWiki. This code only work with
the latest SVN
You need to try it on your wiki.

Ludovic

Xavier MOGHRABI a écrit :

> hi Ludo,
>
> Yes, I've misspelt the 'enctype'.
>
> Anyway, in your example, it seems that it doesn't work well since it doesn't
> display information when I upload my file. Is the problem coming from the
> fact that I don't have the right to upload ?
>
> If I understand well this example, to upload a file I should use 'file' as the
> param of the 'name' such as :
> <input type="file" name="file" />
>
> Regards
>
> Le Jeudi 27 Octobre 2005 11:23, Ludovic Dubost a écrit :
>  
>> Hi Xavier,
>>
>> I suspect you have a mispell in your 'enctype'
>>
>> I've uploaded sample code to xwiki.org which only works on the SVN
>> version of XWiki which has the fileupload plugin.
>>
>> http://www.xwiki.org/xwiki/bin/view/Snipplets/File+Upload?xpage=code
>>
>> Ludovic
>>    
>
>  

--
Ludovic Dubost
XPertNet: http://www.xpertnet.fr/
Blog: http://www.ludovic.org/blog/
XWiki: http://www.xwiki.com
Skype: ldubost AIM: nvludo Yahoo: ludovic




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws