coder icon indicating copy to clipboard operation
coder copied to clipboard

Format for uploading an app

Open gregtoth opened this issue 12 years ago • 9 comments

When creating a new app, there's an "upload" button. What can be uploaded and what's the expected format/structure? Tried uploading a entire .zip file clone of an entire app but that doesn't seem to work.

gregtoth avatar Sep 18 '13 15:09 gregtoth

It expects an app that was exported from coder. If you create a new app, go to its settings panel in the editor, and click export, you can get a zip of that app and see how it's supposed to be structured. This makes it easier to pass an app around between devices or to do a quick backup of a project.

Hope this helps! On Sep 18, 2013 11:11 AM, "Greg Toth" [email protected] wrote:

When creating a new app, there's an "upload" button. What can be uploaded and what's the expected format/structure? Tried uploading a entire .zip file clone of an entire app but that doesn't seem to work.

— Reply to this email directly or view it on GitHubhttps://github.com/googlecreativelab/coder/issues/24 .

jmstriegel avatar Sep 18 '13 15:09 jmstriegel

That's what I thought. Seems to be an issue for me related to re-zipping a directory using Mac 'compress'. Causes 'Invalid application bundle' when upload. Steps: Export existing app to zip file, unzip, re-zip using Mac 'compress', create new app in the UI, click Import button, select re-zipped file, and try to import. Generates 'Invalid application bundle' at that point. Importing the exact-same Export zip file works fine.

gregtoth avatar Sep 18 '13 15:09 gregtoth

Strange. I'm curious about what could be different. You're right clicking the directory and hitting compress? On Sep 18, 2013 11:39 AM, "Greg Toth" [email protected] wrote:

That's what I thought. Seems to be an issue for me related to re-zipping a directory using Mac 'compress'. Causes 'Invalid application bundle' when upload. Steps: Export existing app to zip file, unzip, re-zip using Mac 'compress', create new app in the UI, click Import button, select re-zipped file, and try to import. Generates 'Invalid application bundle' at that point. Importing the exact-same Export zip file works fine.

— Reply to this email directly or view it on GitHubhttps://github.com/googlecreativelab/coder/issues/24#issuecomment-24674622 .

jmstriegel avatar Sep 18 '13 15:09 jmstriegel

Yes. Will try command line zip to see if works any different.

Same issue if zip from command line.

gregtoth avatar Sep 18 '13 15:09 gregtoth

I see the zip files in /tmp on the pi, and can unzip them. They contain a bunch of __MACOSX directories with additional dot files in them such as .DS_Store, ._app, etc. Wondering if that is causing problems.

gregtoth avatar Sep 18 '13 15:09 gregtoth

I think I found the problem, will test. When you compress a directory, the directory name is at the root of the paths in the zip file. The js import code isn't expecting an additional directory layer. Let me test this and I'll report back.

Yes, that's the problem!

gregtoth avatar Sep 18 '13 15:09 gregtoth

Cool. So I think you can select the files rather than the parent directory, and compress them. That'll let you mess with things outside of Coder and then pull it back in.

jmstriegel avatar Sep 18 '13 17:09 jmstriegel

Sure - it's fine for me. Wouldn't be too hard to automatically handle in the upload code on the pi for everyone else. Looks like would just need some additional logic in completeImport() and alter tmpfolder by appending the additional directory level.

gregtoth avatar Sep 18 '13 23:09 gregtoth

I added code to the app uploader to transparently handle extra directory level and sent a pull request.

gregtoth avatar Sep 21 '13 16:09 gregtoth