Forums / Developer / ezBinaryfile filepath

ezBinaryfile filepath

Author Message

Romain Dausset

Wednesday 09 May 2007 6:35:38 am

Hello all,

I would like to change the value of the 'filepath' attribute of an ezBinaryFile.

I can already get this attribute but it doesn't work when i try to change it.

Get filepath attribute of my file :

		$dataMap = $object->attribute( 'data_map' );
		$contentObject = $dataMap['file'];

		$file = $contentObject->attribute( 'content' );

		$filepath = $file->attribute( 'filepath' );

Change it : (don't work)

		$file->setAttribute( 'filepath', $newpath );	
		$file->store();

Any ideas ?

Thx,
Romain.

--
Romain Dausset

rdausset@facileit.com

http://www.facileit.com

Romain Dausset

Thursday 10 May 2007 2:47:29 am

Up !

It's a dead or life situation for me .. ^^ So any ideas ?

Thx.

--
Romain Dausset

rdausset@facileit.com

http://www.facileit.com

Frédéric DAVID

Thursday 10 May 2007 5:26:22 am

When you want to use the eZ publish API, some functions required the & to add a reference.

You can try :

$dataMap =& $object->dataMap();
$attributeFile = $dataMap['file'];

$file =& $attributeFile->content();
$file->setAttribute( 'filepath', $newpath ); 
$file->store();

I haven't test this code, but it can help you a little.

Blog : http://www.frefred.fr/blog/ez-publish
feZ Meta Data : http://projects.ez.no/fezmetadata

Romain Dausset

Thursday 10 May 2007 5:47:18 am

Thank you for your reply, I've test it and it's not the solution.

In fact, the ezbinaryfile seems to be a very particular datatype.

I found this post about it : http://ez.no/community/forum/developer/importing_pdf_files_storing_ezbinaryfile_types_using_php/re_importing_pdf_files_storing_ezbinaryfile__6

So now I'm trying to use the function insertRegularFile, just to change the filepath...

--
Romain Dausset

rdausset@facileit.com

http://www.facileit.com

Romain Dausset

Thursday 10 May 2007 6:32:10 am

Someone have ever used the function " insertRegularFile()" ?

Which is in : "kernel/classes/datatypes/ezmedia/ezmediatype.php"

I'm using it like that :

insertRegularFile(&$object, $objectVersion, $objectLanguage, &$objectAttribute, $filepath, &$result);

But I got a fatal error when i try to use it :
Fatal error: Call to undefined function: insertregularfile()

Thx for helping ^^

--
Romain Dausset

rdausset@facileit.com

http://www.facileit.com

Xavier Dutoit

Thursday 10 May 2007 9:18:49 am

Hi,

What's the goal of changing the filepath ?

X+

http://www.sydesy.com

Romain Dausset

Monday 14 May 2007 1:21:16 am

Hi,

The the goal is to keep the ez file system to manage file upload, and upload this files on a distant server.

But I've made a solution, creating my own file class to store file informations ( adress, size mimy type... ) and upload on my distant server.

++
Rom.

--
Romain Dausset

rdausset@facileit.com

http://www.facileit.com

eZ debug

Timing: Jan 30 2025 00:56:06
Script start
Timing: Jan 30 2025 00:56:06
Module start 'content'
Timing: Jan 30 2025 00:56:06
Module end 'content'
Timing: Jan 30 2025 00:56:06
Script end

Main resources:

Total runtime0.1599 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 587.8281180.8438
Module start 'content' 0.00600.0070 768.6719101.9609
Module end 'content' 0.01300.1469 870.6328530.7344
Script end 0.1598  1,401.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00362.2765200.0002
Check MTime0.00140.8746200.0001
Mysql Total
Database connection0.00070.408410.0007
Mysqli_queries0.109068.13761410.0008
Looping result0.00110.70941390.0000
Template Total0.146491.610.1464
Template load0.00100.607910.0010
Template processing0.145590.969910.1455
Override
Cache load0.00070.412810.0007
Sytem overhead
Fetch class attribute can translate value0.00130.814810.0013
XML
Image XML parsing0.00020.138810.0002
General
dbfile0.01207.4954200.0006
String conversion0.00000.004030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs