Hi Daniel,
I’ve tried it now, but get some Warnings.
My Code now looks like this:
$filename = $myFile[‘name’];
$path = $myFile[‘tmp_name’];
$contents = file_get_contents($path);
$filehandle = egw_vfs::fopen("/apps/calendar/$id/$filename", “w”);
fwrite($filehandle, $contents);
fclose($filehandle);
And i get the following error:
Warning: fopen(links://default/apps/calendar/1/PascalInt.doc): failed to
open stream: “links_stream_wrapper::stream_open” call failed in
/var/www/phpgwapi/inc/class.vfs_stream_wrapper.inc.php on line 244
Warning:fopen(vfs://default/apps/calendar/1/PascalInt.doc): failed to open stream:
“vfs_stream_wrapper::stream_open” call failed in
/var/www/phpgwapi/inc/class.egw_vfs.inc.php on line 123
Does calendar entry with id 1 exists in EGroupware AND do you (the user
logged into egroupware) are at least a participant or has edit grants
from the event owner?
Warning: fwrite() expects parameter 1 to be resource, boolean given in
/var/www/averp/soap/inc/soap_calendar.php on line 27 Warning: fclose()
expects parameter 1 to be resource, boolean given in
/var/www/averp/soap/inc/soap_calendar.php on line 28 int(1)
This are just following errors because fopen returned false.
Then I tried another solution:
$filename = $myFile[‘name’];
$path = $myFile[‘tmp_name’];
$contents = file_get_contents($path);
file_put_contents(egw_vfs::PREFIX."/apps/calendar/$id/$filename",$contents);
But here i get a warning, too:
Warning: fopen(links://default/apps/calendar/1/PascalInt.doc): failed to
open stream: “links_stream_wrapper::stream_open” call failed in
/var/www/phpgwapi/inc/class.vfs_stream_wrapper.inc.php on line 244 Warning:
file_put_contents(vfs://default/apps/calendar/1/PascalInt.doc): failed to
open stream: “vfs_stream_wrapper::stream_open” call failed in
/var/www/averp/soap/inc/soap_calendar.php on line 30 int(1)
Does the same thing and therefore gives a similar result.
It could also be your VFS is not working correctly.
Does uploading files in Filemanager works?
Maybe it’s a permission issue in EGroupware’s files directory.
Ralf
Kind regards
i. A. Daniel Maier
AvERP – Programmer
SYNERPY GmbH
Chr.-Ritter-v.-Langheinrich-Str. 7 Fon: +49(0)921 6080093-0
D-95448 Bayreuth Fax: +49(0)921 6080093-93
www.synerpy.de E-Mail: info@synerpy.de
View this message in context: http://egroupware.219119.n3.nabble.com/File-Attachment-on-Calendar-Entry-over-API-tp3992092p3992142.html
Sent from the egroupware-developers mailing list archive at Nabble.com.
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It’s a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
–
Ralf Becker
Director Software Development
Stylite AG
Morschheimer Strasse 15 | Tel. +49 6352 70629 0
D-67292 Kirchheimbolanden | Fax. +49 6352 70629 30
Email: rb@stylite.de
www.stylite.de | www.egroupware.org
Managing Directors: Andre Keller | Ralf Becker | Gudrun Mueller
Chairman of the supervisory board: Prof. Dr. Birger Leon Kropshofer
VAT DE214280951 | Registered HRB 31158 Kaiserslautern Germany
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers