Apache OpenOffice (AOO) Bugzilla – Issue 118886
[FTP ucp] css.ucb.SimpleFileAccess.copy() fails
Last modified: 2017-05-20 09:32:05 UTC
Bug with the following method if the StartFile comes from a distant server. demenageur = createUnoService("com.sun.star.ucb.SimpleFileAccess") demenageur.copy(StartFile, ArrivalFichier) Exemple: Sub CopieDeFichier dim oDoc, oSheet, oCell oDoc = ThisComponent REM ***** COPIE D'UN FICHIER DANS LE DOSSIER COURANT ***** REM ***** RECHERCHE DU DOSSIER COURANT ***** Chemin = oDoc.location FichierDepart = Chemin i=0 'Recherche le nom du dossier du fichier courant For i=Len(Chemin) to 1 step -1 If Right(Left(Chemin, i), 1) = "/" then 'Nom du dossier ou est le fichier courant Chemin = Left(Chemin, i) exit for end if next FichierArrivee = Chemin & "Nouveau Fichier.ods" REM ***** COPIE D'UN FICHIER LOCAL - OK NO BUG (rename and copy) ***** dim demenageur As Object demenageur = createUnoService("com.sun.star.ucb.SimpleFileAccess") demenageur.copy(FichierDepart,FichierArrivee) REM ***** COPIE D'UN FICHIER DISTANT - ERREUR ***** ' Please write your own distant file's address as below 'FichierDepart = ftp://dossier%40monsite.com:pw@ftp.monsite.com/MonFichier.ods" demenageur = createUnoService("com.sun.star.ucb.SimpleFileAccess") demenageur.copy(FichierDepart,FichierArrivee) 'in this case, an error message appear end sub
Incoming file's communication with and external source (as a server) is not working since Ooo version 3.2.1. It includes the function of the service com.sun.star.ucb.SimpleFileAccess but also the link function as it appears in the following exemple: =LIEN.HYPERTEXTE("ftp://directory%40mydomain.com:mypassword@ftp.mydomain.com/myfile.ods";"Description in cell") However, note than the success of the function depends of the nature of the file. For exemple, this function calling a pdf file is working: =LIEN.HYPERTEXTE("ftp://directory%40mydomain.com:mypassword@ftp.mydomain.com/myfile.pdf";"pdf file") ...but calling the opening of a ods file doesn't work =LIEN.HYPERTEXTE("ftp://directory%40mydomain.com:mypassword@ftp.mydomain.com/myfile.ods";"ods file") It looks like since 3.2.1, Ooo cannot handle a command involving a distant file.
I mean version 3.2.1 is working fine. Problems involving external files began after this version.
(In reply to comment #1) > but also the link function as it appears > in the following exemple: > > > =LIEN.HYPERTEXTE("ftp://directory%40mydomain.com:mypassword@ftp.mydomain.com/myfile.ods";"Description in cell") The function is not broken. The function simply shows an hyperlink text. When you click, I assume OpenOffice tells the system to open the hyperlink, and the system chooses the default application associated to the file extension. So I guess it is working for PDF, HTML, etc. but not for OpenOffice files: in this case, the system tells OpenOffice to open the file, OpenOffice fails to open the file on an FTP server.
Created attachment 80720 [details] Macro's section and error's message As far as I understand, the link function (lien.hypertexte) involving ftp address cannot handle the opening of Open office files. Effectively others files seem ok. However, coping any files FROM ftp folder TO local folder doesn't work after version 3.2.1. Note that there is no problem FROM local folder TO ftp folder. This bug force our organization to stay with an old version. So I hope someone can find witch change cause this bug and handle it. Hopefully at least for version 4!
Fixed with revision 1488548
Created attachment 80758 [details] Writer document with macro to test Download and store the document to a writeable location Open the macro in the Basic IDE Define in FTPTEST the URL of an FTP server you have access The macro will download the first file in the FTP server's folder. The file is stored relative to the document with the macro.
(In reply to Ariel Constenla-Haile from comment #5) > Fixed with revision 1488548 Nightly build can be found at http://ci.apache.org/projects/openoffice/ Follow http://wiki.openoffice.org/wiki/Run_OOo_versions_parallel (a little outdated) so that this build does not replace your stable version
After trying the new package, I can confirm that the modification solve the problem. Waiting for Aoo 4.0 to be officially publish for everyone with language package. Thank's for your effort and competence.