Forums / Developer / MultipleFileUpload extension discussion

MultipleFileUpload extension discussion

Author Message

Patrizio Bekerle

Thursday 21 April 2005 2:46:55 am

Please post your wishes and other conversation here...

- Patrizio

Ralph Ekekihl

Thursday 21 April 2005 3:15:54 am

I am actually working on a Multiple File uploader for binary files. I am using Jupload from jupload.sourceforge.net cause it is GPL. Had to add some features like cookie handling to the Java Applet first, but now its running as I want.

The storing in eZpublish is more complicated then I first thought.
I am using the eZbinary type to store the files, but running into some problems there, when having multiple ezbinaryfiles in the same contentobjectattribute, so its more work then I expected.

Maybe we switch some ideas?

Take Care

Contactivity B.V.
http://www.contactivity.com

Patrizio Bekerle

Thursday 21 April 2005 3:55:43 am

That's why I only support images at the moment ;-)

What do you mean with:
"multiple ezbinaryfiles in the same contentobjectattribute"

-- Patrizio

Ralph Ekekihl

Thursday 21 April 2005 5:33:28 am

Bascially I am making a new datatype that supports multiple binary files, instead of only one, as the current datatype.

To do it without having to add any fields to the tables ezbinaryfile I need to set the binary files to the same contentobject_attribute_id, the one of the datatype.

Also been thinking of using objectrelations somehow, but dont know how to solve that nicely.

Are you following me?
You have any ideas for another solution?

Contactivity B.V.
http://www.contactivity.com

Patrizio Bekerle

Thursday 21 April 2005 5:44:13 am

Why do you need a "multiple binary files datatype"?
Why don't you create multiple "normal" binaryfile content objects like I do it with images?

-- Patrizio

Ralph Ekekihl

Thursday 21 April 2005 6:11:59 am

The customer wants a datatype with many binaryfiles in it.
I can make it normal objects like you, but then they dont belong to a
datatype, and I'm not sure how
to group and display them logically.

Contactivity B.V.
http://www.contactivity.com

Daniel Beyer

Thursday 21 April 2005 6:18:54 am

I think the best and easiest way of getting multiple files in one object without having more than one ezbinaryfile in class is with ezobjectrelationlist.

To setup this just do the following:
1. Add a new attribute of datatype ezobjectrelationlist in the class where you want to have multiple file-uploads
2. Set up this new attribute as you need it. E.g. say only objects of class "binaryfile" can be related and shouldn't be stored in the content-tree.
3. Create a new object of your class. You now can create other objects within this object of the class binaryfile.
4. Create new templates and overrides for your class. Standard eZ publish doesn't come with working ones for embeded views with ezobjectrelationlist.

Tips and tricks:
-You can create a new class replacing the class binaryfile if the standard-class binaryfile does not fit your needs (e.g. you think there are to many fields within that class)
-Just copy the full view of ezbinaryfile to the embed view in our design-override and set up your override.ini. Compare it with the overrides for the article, wich has some embed-entries.

How nice this works (even for other needs than fileupload - e.g. images, texts, links, ...) you can see on your website on this page: http://web.ymc.ch/kunden/success_stories/soreon_research

We use for this page a class which looks like this:
-Name (ezstring)
-Shortname (ezstring)
-Attributes (ezobjectrelationlist)

For the attributes we can use the following classes:
-Image (form standard-setup)
-Link (form standard-setup)
-File (from standar-setup)
-Flash (form standard-setup)
-Quicktime (form standard-setup)
-Windows Media (form standard-setup)
-Real Video (form standard-setup)
-Textline (new class with just one attribute of datatype ezstring)
-Textarea (new class with just one attribute of datatype eztext)
-XMLtextarea (new class with just one attribute of datatype ezsxmltext)
-Paragraph (new class which just adds a paragraph of specific height)

Daniel Beyer
_________________________________
YMC AG
Kreuzlingen, Switzerland
web: www.ymc.ch
____________________________________

Patrizio Bekerle

Thursday 21 April 2005 6:33:11 am

You can also store multiple binary content objects as child of a parent object and sort the childs with the "priority" field.

-- Patrizio

Ralph Ekekihl

Thursday 28 April 2005 3:04:13 am

Thank you both for your input, was really helpful!

Solution I did was to implement the ezobjectrelationlist in the datatype.
So every binaryfile uploaded is created as a "hidden/not shown in content tree" object with a relation, so now you can have many binaryfiles in a single classattribute. Works really good aswell.
Just going to write some documentation, then I will publish it on the contributions.

//Ralph

Contactivity B.V.
http://www.contactivity.com

Lex 007

Thursday 15 September 2005 7:12:35 am

Hi,

I've got the following problem with your (great) extension with the following config :
- eZ 3.6.1
- PHP 4.3.11
- Apache under Windows XP

The image object is created and the name of ths image is correct. But the image file is not assigned to the image field. I have noticed in the logs that the script is not able to find the TEMP file created during teh upload.

Any idea ? Thx

Patrizio Bekerle

Thursday 15 September 2005 7:27:03 am

@Lex 007:
Hotfix:
Edit extension/multiplefileupload/modules/multiplefileupload/upload_process.php and write

$separator = ( substr( php_uname(), 0, 7 ) == "Windows" ) ? '\\' : '/';
$uniqueNameArray = explode( $separator, $uniqueName );

in line 192 instead of:

$uniqueNameArray = explode( '\\', $uniqueName );

(and please let me know if it worked ^^)

Lex 007

Thursday 15 September 2005 7:43:28 am

Wow, that was fast :)

Worked perfectly, thanks.

Lex 007

Sunday 25 September 2005 11:05:41 am

Hi,

I've got another problem : When I try to upload files for over 7 MBytes, the images objects are not created. I set upload_max_filesize to 100MBytes in php.ini, no change.

Thx for your help.

Patrizio Bekerle

Monday 26 September 2005 12:59:23 am

This is a php restriction. You have to set your memory_limit, upload_max_filesize and post_max_size to a higher value. For example in your httpd.conf for your virtual host like this:

php_value memory_limit "18M"
php_admin_value upload_max_filesize "18M"
php_admin_value post_max_size "18M"

- Patrizio

Vladimir Makarov

Saturday 18 March 2006 12:16:50 pm

Hi all!

I've spend weekend in search possible reason, why this great extension didn't work properly fo my installation.

And I've found that reason:
Although JUpload have actionURL

http://localhost:1338/layout/set/multiplefileupload/multiplefileupload/upload_process/4785

but it POSTed data to user site, e.g. http://localhost for its default port 80.

Anyone have ideas on this strange behavior?

piece of upload_process debug:

Debug: current siteaccess <kernel-siteaccess>
Mar 18 2006 22:09:25
array(2) {
  ["name"]=>
  string(8) "intranet"
  ["type"]=>
  int(1)
}

from site.ini:

[SiteSettings]
DefaultAccess=intranet

Patrizio Bekerle

Saturday 18 March 2006 3:22:00 pm

Hm, is localhost realy your siteurl? What did you set in your site.ini.append.php?
And btw. did you try the eZP Webdav support, you can upload images with it too if my MultipleFileUpload doesnt work for you.

cheers, Patrizio

Siniša Šehović

Sunday 19 March 2006 2:14:58 am

Hi Patrizio

Does your extension work on ezpublish 3.7.4?

S.

---
If at first you don't succeed, look in the trash for the instructions.

Vladimir Makarov

Sunday 19 March 2006 3:01:00 am

Yes, my development site is on localhost, but site.ini.append.php contains production site info:

[SiteSettings]
DefaultAccess=intranet
SiteList[]=intranet
SiteURL=KIS

So, does it matter?

P.S. I've tryed WebDAV on its early implementation in eZPublish, but wasn't able to setup it properly too. Then I've installed your extension, and it work sometimes...

Patrizio Bekerle

Sunday 19 March 2006 12:43:17 pm

@Sinisa: should also work with 3.7.4
@Vladimir Makarov: the actionURL part is a bit tricky, i have to generate it from $_SERVER["REQUEST_URI"]. So it seems that "localhost:1338" is part of your REQUEST_URI...

cheers, Patrizio

PS: WebDAV works like a charm on many servers for me. You need to setup a different virtual host for it.

Vladimir Makarov

Sunday 19 March 2006 1:15:19 pm

Yes, <i>localhost:1338</i> is in server var <i>$_SERVER["HTTP_HOST"]</i>.
and it is right for access 'admin' part of my site (I use port access matching: 1338 for admin, 80 for user).
But the problem is JUpload send its request for '/layout/set/multiplefileupload/multiplefileupload/upload_process/XXX' to usual 'localhost' without any ports (80 for my 'user' part) although its actionURL contains 'http://localhost:1338/layout/set/multiplefileupload/multiplefileupload/upload_process/4785', i.e. it ignore port!...

About WebDAV - it works only with ascii named content, but not with russian one (UTF8 coded requests couldn't be decoded into proper NodeID )... :

2006-03-19 22:57:23 : ========================================
2006-03-19 22:57:23 : Requested URI is: /admin/Content/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8 [webdav.php]
2006-03-19 22:57:23 : start path: /admin/Content/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8 [CS:currentSitePath]
2006-03-19 22:57:23 : indexdir: /admin/Content/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8 [CS:currentSitePath]
2006-03-19 22:57:23 : site admin: /admin/Content/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8 [CS:currentSitePath]
2006-03-19 22:57:23 : Logged in: 'admin' [webdav.php]
2006-03-19 22:57:23 : WebDAV server started... [processClientRequest]
2006-03-19 22:57:23 : start url: /admin/Content/&#1053;&#1086;&#1074;&#1086;&#1089;&#1090;&#1080; [CS:processURL]
2006-03-19 22:57:23 : indexdir url: admin/Content/&#1053;&#1086;&#1074;&#1086;&#1089;&#1090;&#1080; [CS:processURL]
2006-03-19 22:57:23 : ----------------------------------------
2006-03-19 22:57:23 : Client says: PROPFIND [processClientRequest]
2006-03-19 22:57:23 : Target: /admin/Content/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8 [processClientRequest]
2006-03-19 22:57:23 : ----------------------------------------
2006-03-19 22:57:23 : PROPFIND was issued from client. [processClientRequest]
2006-03-19 22:57:23 : Depth: 0. [processClientRequest]
2006-03-19 22:57:23 : Check virtual folder: site 'admin' in 'Content/&#1053;&#1086;&#1074;&#1086;&#1089;&#1090;&#1080;'  [CS:getCollectionContent]
2006-03-19 22:57:23 : Can access 'admin' and 'Content' [CS:userHasVirtualAccess]
2006-03-19 22:57:23 : Content collection: from site 'admin' in 'Content' using path '&#1053;&#1086;&#1074;&#1086;&#1089;&#1090;&#1080;' [CS:getCollectionContent]
2006-03-19 22:57:23 : Node translation failed: rkjrzriirzsgs_rio [CS:fetchNodeByTranslation]
2006-03-19 22:57:23 : No nodeID [CS:fetchNodeByTranslation]
2006-03-19 22:57:23 : Unknown node: &#1053;&#1086;&#1074;&#1086;&#1089;&#1090;&#1080; [CS:getCollectionContent]
2006-03-19 22:57:23 : handle function was called with status: 31 [handle]