Issue 118886 - [FTP ucp] css.ucb.SimpleFileAccess.copy() fails
Summary: [FTP ucp] css.ucb.SimpleFileAccess.copy() fails
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.4.1
Hardware: PC All
: P3 Normal
Target Milestone: 4.0.0
Assignee: Ariel Constenla-Haile
QA Contact:
URL:
Keywords:
Depends on: 122357
Blocks:
  Show dependency tree
 
Reported: 2012-02-07 22:31 UTC by Rémy Meunier
Modified: 2017-05-20 09:32 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Macro's section and error's message (62.94 KB, image/jpeg)
2013-05-22 14:52 UTC, Rémy Meunier
no flags Details
Writer document with macro to test (9.94 KB, application/vnd.oasis.opendocument.text)
2013-06-01 17:40 UTC, Ariel Constenla-Haile
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Rémy Meunier 2012-02-07 22:31:30 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
Comment 1 Rémy Meunier 2013-05-21 16:11:42 UTC
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.
Comment 2 Rémy Meunier 2013-05-21 16:19:19 UTC
I mean version 3.2.1 is working fine.  Problems involving external files began after this version.
Comment 3 Ariel Constenla-Haile 2013-05-21 21:34:41 UTC
(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.
Comment 4 Rémy Meunier 2013-05-22 14:52:28 UTC
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!
Comment 5 Ariel Constenla-Haile 2013-06-01 17:22:45 UTC
Fixed with revision 1488548
Comment 6 Ariel Constenla-Haile 2013-06-01 17:40:47 UTC
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.
Comment 7 Ariel Constenla-Haile 2013-06-02 20:02:22 UTC
(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
Comment 8 Rémy Meunier 2013-06-18 14:27:25 UTC
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.