Problems with syncing documents from iWorks
Hello, it's impossible (or hard) for me to sync files from iWorks (Pages, Numbers, Keynote).
A file (or directory, what it's in fact) created by Pages looks like this:
drwxr-xr-x@ 8 lucas staff 272 5 Feb 23:03 Test.pages
In Finder, the suffix is not visible
If I upload this file to my OwnCloud (using the website) and download this file again, I get this output:
-rw-r--r--@ 1 lucas staff 42098 5 Feb 23:03 Test.pages
This is a file (OwnCloud also shows it as a file) and Pages fails to open it. But if I rename it to *.pages.zip and extract it, Pages can open it fine! It's named Test.pages then, but it's possible to remove the *.pages part using Finder and it remains a *.pages file:
drwxr-xr-x@ 8 lucas staff 272 5 Feb 23:03 Test.pages <# After renaming to *.pages.zip & extracting
If I use the OS X client to upload the file and download it using the website, I get a *.pages.zip file and after extracting I get this output:
drwxr-xr-x@ 8 lucas staff 272 5 Feb 23:03 Test.pages
This is a folder (OwnCloud also shows it as a folder) and Pages opens it just fine. It also has the *.pages suffix in Finder, which I can remove without problems (I wonder how this is working btw, as 'ls' shows no difference - still *.pages suffix, but nothing in Finder anymore.).
I noticed that Dropbox and Google Drive also have serious problems with the new iWorks format and that this issue might be hard to solve.
Can someone with a Mac confirm this ? @georgehrke @raghunayyar
@lucasribic I'm not sure I understand what your problem is and what is expected (I'm not a Mac user). Can you provide simple steps to reproduce the issue and specify expected behavior / actual behavior ? (see https://raw.github.com/owncloud/core/master/issue_template.md)
Are you saying that if you upload a "test.Pages" file using the web upload, then download it again, it appears as "test.pages" but can't be opened any more with iWorks ?
In the following I'll refer to *.pages files, but the same also applies to files created by Numbers and Keynote.
Expected behavior
Documents created by Pages (*.pages) upload/sync correctly to OwnCloud. They are shown as files in the web interface and it's possible to download them. After downloading, the *.pages suffix is not shown.
Actual behavior
Document uploaded by web interface:
Document is displayed as *.pages file in the web interface. If you download the file and try to open it, Pages will fail to do so. To make it work after downloading the file, it's necessary to name the file *.pages.zip and extract it. The *.pages suffix is still shown.
Document uploaded by OS X client:
Document is displayed as *.pages folder in the web interface. If you download the folder, you'll get a *.pages.zip file. Extracting this leads to a working *.pages file. The *.pages suffix is still shown.
If I rename the file uploaded by the OS X client using the web interface, e.g. to Test2, it syncs fine and I get a valid file in my local OwnCloud folder.
Steps to reproduce
- Create a new document using Pages 5.X
- Sync it to your OwnCloud using web interface or OS X client
Server configuration
Operating system: Debian 7.3
Web server: nginx 1.4.4
Database: MySQL 5.5.35-0+wheezy1
PHP version: PHP 5.5.8-1~dotdeb.1
ownCloud version: ownCloud 6.0.1 (stable)
Updated from an older ownCloud or fresh install: Fresh install
List of activated app:
- Deleted files
- Encryption
- First Run Wizard
- Full Text Search
- PDF Viewer
- Share Files
- Text Editor
- Updater
- Versions
- Video Viewer
The content of config/config.php:
<?php
$CONFIG = array (
'instanceid' => 'oc43f0a6a3ee',
'passwordsalt' => 'XXXXX',
'datadirectory' => 'XXXXX',
'dbtype' => 'mysql',
'version' => '6.0.0.16',
'dbname' => 'XXXXX',
'dbhost' => 'localhost',
'dbtableprefix' => 'XXXXX',
'dbuser' => 'XXXXX',
'dbpassword' => 'XXXXX',
'installed' => true,
'forcessl' => true,
'mail_domain' => 'XXXXX',
'enable_previews' => false,
);
Are you using external storage, if yes which one: No external storage
Client configuration
Browser: Safari 7.0.1 (9537.73.11)
Operating system: OS X 10.9.1 Mavericks
Programs: Pages 5.1
Logs
Web server error log
Insert your webserver log here
ownCloud log (data/owncloud.log)
No log line has been written regarding the Pages documents
Browser log
Insert your browser log here, this could for example include:
a) The javascript console log
b) The network log
c) ...
This is how the document originally looks:

This is how the document looks after uploading it through the OS X client:

This is how the document looks after uploading it through the web interface:

Thanks for the details. ownCloud doesn't automatically zip files on upload.
From the "ls" in your first comment it looks like the "Test.pages" on your local computer is in a fact a folder.
drwxr-xr-x@ 8 lucas staff 272 5 Feb 23:03 Test.pages
It looks like the Mac OS makes them look like files and also allows you to upload them using the Web UI, as folders, somehow, even though we don't support folder upload.
When uploading, are you using drag and drop from Finder to the browser or are you using the "Upload" button ?
When using the sync client, since "Test.pages" is a folder, the client will simply upload it as a folder. If you want to download it, it will need to zip it (this is the case for all folders) and provide a download. I don't understand why the downloaded file doesn't have the zip extension. Maybe Mac OS detects that it's a pages file and tries to remove it ?
I don't think there is much we can do here, it seems that there is some Mac OS magic going on here.
ownCloud doesn't automatically zip files on upload.
Then probably Safari zips the file, uploading the file using Google Chrome and the "Upload" button completely fails (Datei konnte nur teilweise übertragen werden). If I upload it using drag-and-drop, it will upload the files inside the *.pages folder (Google Chrome). On the other hand, uploading with Safari using drag-and-drop results in the same *.pages zip archive I get when using the "Upload" button.
From the "ls" in your first comment it looks like the "Test.pages" on your local computer is in a fact a folder.
Yes, it's a folder (I also wrote this in the first post), I even can 'cd' into it.
When uploading, are you using drag and drop from Finder to the browser or are you using the "Upload" button ?
So far I always used the "Upload" button.
I don't understand why the downloaded file doesn't have the zip extension.
No no no, it has the zip extension after downloading if I synced it with the OS X client. It only lacks the zip extension if I upload the document using the "Upload" button, but then it's a file anyway.
I don't think there is much we can do here, it seems that there is some Mac OS magic going on here.
Hmm, I think you can at least improve this situation. If the document is synced using the client, it will create the correct folder with the .pages extension. Then OwnCloud just has to display every folder with an *.pages (or *.numbers/.key) extensions as a file. Downloading the document with the *.pages.zip extension is fine, one double-click and it's extracted. If the file is uploaded using the web interface, OwnCloud should check for files with *.pages extension and extract them to the *.pages folder. Maybe OwnCloud also has to take care of older iWork files...
I don't know much about the OwnCloud architecture. Can you tell me if it's possible to realize this behavior with a plugin?
In my opinion it's seriously retarded from Apple to introduce this format. I guess they just made this step to push iCloud.
So if I understand well the expected behavior would simply: make the "*.pages" folders appear as a file with a specific icon and prevent the user to navigate into it, correct ?
I don't think it can be done directly with a plugin/app yet. We currently don't support custom mimetypes / icons for folders, so that's something that would need to be added first.
Only "prevent the user to navigate into such folders" could be done by an app/plugin by overwriting the default action (Open) with a non-operation (do nothing / download)
Yes, almost! I would say it like this:
Make the ".pages" folders (uploaded by OS X client) appear as a file with a specific icon, unzip ".pages" files (uploaded by web interface) to "*.pages" folders and prevent the user to navigate into it.
Does the desktop sync client work correctly ? Let's say you have two computers, on one you put the "*.pages" folder in the sync dir. Does it sync correctly to the second computer ? I'd expect it does.
I only have one OS X computer, so I can't test it with two computers. But I resetted the client, deleted the local files and resynced. It syncs correctly.
Ok it syncs fine but still views online as a folder online. It still corrupts files unfortunately.

As stated in this comment thread, the issue is that "pages" files on Mac aren't really files, they are folders but Mac makes them look like files. And since these are folders, if you download them over the web UI, they will be downloaded as ZIP files as it isn't technically possible to download folders through a web browser.
Ok no problems, the only down side is that syncing between mac's I've come across a number of corrupted iWork files which don't seem to be corrupted when using dropbox etc.
@timrycroft can you elaborate on how the corruption happens ? What kind of corruption is it, are you able to compare the file before and after sync ? Are there any files inside that directory that are maybe ignored by the sync client ?
Basically the preview seems to be missing from the file, so OSX is unable to preview these which I know is just a jpg within the file/ folder... Basically when opening it comes up with an error saying can't open file. I've compared within the file and can't see anything that looks different. Nothing seems different if I compare before and after, its very strange. I'm now looking at the new sync client and for me it seems like it doesn't corrupt the files but still need to test further.
I have a similar problem. very often, the "Data" directory (inside the .pages, .number or .keynotes directory) are empty after synchronization... So the iWork's document is corrupted. This "Data" directory contain only jpeg files of iWork's document. What is the problem?
Hi we have the exact same problem. We were thinking of if the disk format where the files are stored: has it any implication on the compatibility with the .pages, .numbers or .key files? Because these kind of files are not compatible with FAT for example.
We are using an EXT4 drive format, maybe it is the source of the trouble. Anyone can confirm?
See my comment above https://github.com/owncloud/core/issues/7103#issuecomment-35711161 and the proposed enhancement https://github.com/owncloud/core/issues/7103#issuecomment-34355269
@frank: there's need to fix this, is there estimation possibl until when it will be solved?
Summary of the issue: "*.pages" files aren't files but folders, and the Mac makes them look like files on Mac OS.
Here is a summary of the possible enhancement, based on the discussion with @luckyluckyluke :
- Allow mime types for folders (including corresponding icons)
- Make "*.pages" folders appear as files and prevent the user to navigate into them
- When downloading a ".pages" folder, return a zip file but remove the extension from the file name
CC @icewind1991 @georgehrke