Page 1 of 1

The directory name is invalid - Portable Device

Posted: 14 Dec 2015 18:26
by Jacksun
I get this error when I double-click a file on my iPhone to open it with the default program.
in this case its ACDSee for JPEGs and Media Player Classic for movies.

I think it fails because the path it forwards to the application is "ePhone\Internal Storage\DCIM"
and the application won't be able to handle these kind of directories.

Not sure what the solution here could be. But Windows Explorer does this:
It copies the file to a temporary directory and then opens it from there (very lame and slow, but it works).
in my case that temp. directory is this: C:\Users\me\AppData\Local\Microsoft\Windows\INetCache\IE\L2NO325E

I know that handling Portable Devices is a pain in the rear. Alone the "get file list" in such a "folder"
will sometimes take ages and more especially it is not cached, meaning that if you ever return to
the same folder, it will do "get file list" again and it will take again a few seconds (more if you have
1000 or more fotos in that folder). so yeah, I guess the API for handling Portable Devices under
Windows sucks.

I hope there are better ways to work around it?

Thanks!

xyplorer-iphone-open-error.png

Re: The directory name is invalid - Portable Device

Posted: 14 Dec 2015 19:18
by admin
Hi and welcome to the club!

You said it all, and 100% correctly. Opening files from a Portable Device is simply not possible in XY (and this is also stated in the help file). Making a temporary copy and open that would be a solution, but a bad one IMO: What if you want to edit that file? ...

Don

Re: The directory name is invalid - Portable Device

Posted: 14 Dec 2015 19:35
by Jacksun
Thanks Don for your quick response.

Great we agree here. Unfortunate for us, Canon and Apple don't agree and keep using this "Portable Device" system for their devices.

You can't really edit files on a portable device anyway (at least not on my iPhone), I think you can't even add (copy) any files to its 'folders'.

I believe that doing what Windows Explorer does (copy the file to a temp. directory and then opening it with the registered application),
is probably better than having this error message.

What's funny is, that for MOV files it actually does something like that. As soon as I double-click a (large) video file, I see a Windows copy-dialog
copying my video file to some temp. directory. But then the open fails nonetheless.
Just verified, the MOV file is indeed here: C:\Users\me\AppData\Local\Microsoft\Windows\INetCache\IE\QOKC8RWL

Not sure if that happens to JPEG files - at least I don't see the copy-dialog (maybe to fast to see) and I don't see the file in that temp. folder.

I'd be happy to see any kind of solution for that.


Also just checked the XY preview feature (F11) for these files on that potrable device:
As far as I see it opens only the file's thumbnail because the quality is really bad.
Also the EXIF rotation flag is not honored in the preview and in the thumbnail list.
That stuff is a minor issue in my opinion.


Thanks for looking into that. Cheers

Re: The directory name is invalid - Portable Device

Posted: 14 Dec 2015 21:26
by klownboy
Very coincidental, I was copying images from my girl friend's iPhone4 to my computer just to see which ones I may like to keep for myself. She just bought a new iPhone6s and copied all the photos from old to the new iPhone via the cloud (iTunes). Like Jacksun, I was able to see the folders and the image file listings in each of the folders, but was unable to view the photos directly from the iPhone. I was also able to use XYplorer's "copy to" menu to copy all the image files (jpg) to my harddrive. I never tried Windows Explorer.

Not a huge deal because it doesn't happen that often, but to be honest though Don, it would have been nice to be able to view the photos on the iPhone to decide whether I wanted to copy them rather than having to blindly copy them all. So I can definitely see a benefit in being able to properly view the files. I don't think anybody is going to expect to be able to edit those images at least not while on the iPhone. Thanks.

Re: The directory name is invalid - Portable Device

Posted: 15 Dec 2015 10:32
by admin
OK, I will eventually come back to something like Portable Devices 2.0, i.e. I will revise the code and approach to this ugly and sad topic ;) This is nothing that can be fixed quickly. There is hardly any documentation, and even what's documented often does not work. A complete mess, to me a clear signature of the Balmer years.

Conc. the thumbnails, first of all I'm surprised that you could even list (let alone copy) files on the iPhone. I thought that was not possible (and Apple would do anything to prevent this). Second, the picture preview only works when there are embedded thumbnails, else no chance. Not sure about the rotation at the moment.

Re: The directory name is invalid - Portable Device

Posted: 15 Dec 2015 14:24
by klownboy
admin wrote:I'm surprised that you could even list (let alone copy) files on the iPhone
I was surprised too. When I connect via USB a dialog comes up on the iPhone asking if I "Trust" or "Cancel". After selecting "Trust", I did have to exit and restart XY, but once I did I was able to see the DCM folder with all the pictures subfolders below it. Maybe it's the operating system (Windows 10 with Threshold 2), but XYplorer displays the iPhone as "Apple iPhone" as opposed to Jacksun display as ephone.
iPhone cnnected to XYplorer.JPG
As jacksun stated, none of my image viewers would display the images directly because of the "Directory name is invalid" error message. It's interesting to note though that if I start an image program like IrfanView separately and use it to open the images, it does work. Irfanview is doing the same thing that Windows Explorer does, copy the file(s) to the user temporary folder such that they can be viewed and displays the image thumbnails in the "Open" dialog box.

Re: The directory name is invalid - Portable Device

Posted: 15 Dec 2015 20:07
by Jacksun
a few more notes:

- My phone has the name "ePhone" thats why it shows something different for you, yours is the default name of the iPhone.
you can change the name in the iPhone settings and it will reflect when connecting to the computer.

- connecting the iphone to the laptop and copying pictures FROM the phone works for me since a many years, I'd say at least
since 2012 and Windows 7, probably before. what the iphone is doing here, is behaving like a camera (portable device).
Canon cameras and alot of other manufacturs use the same (sad) interface and its same (sad) experience.

- yes, its the embedded thumbnails that are shows on that portable device. that usually works fine, but its slow. rotation
works fine on windows explorer with those

- years ago, the default was the "removable storage medium" interface, where you basically got the entire filesystem of the
storage (i.e. SD card) and that worked just like a (external) hard-disk. for SD-cards I always use the built-in card-reader,
as this is MUCH faster and offers the same features as a real filesystem. however, sometimes I do have CF-cards or ipads,
iphones etc. where all you can do is connect it with a USB cable and laugh at the sad Ballmer "portable device" interface.

- so while you can use itunes to backup your pictures etc. it has always been a pain for me to actually simply copy a random
image or video, without going through the whole sync-procedure. and thats especially helpful on foreign computers of your
friends. these days people share photos via the cloud, but for a few 5min HD-videos, that really takes ages. and they might
be re-compressed and loose quality (ugh).


@admin: Is there any chance you can get a "small" fix running any soon? I.e. as I said in a previous post, the videos files
already get copied to a temp directory, but not opened because of the wrong path.

as for the mid-term solution: i would like to see the "file listing" gets cached by XY - that would be awesome. and F5 actually
forces the Ballmer refresh. I would also be happy to see all that handling be done in the background thread, since any
operations on a portable device will lock-down and almost freeze your browsing in XY (and Windows Explorer).


thanks alot and good luck :-)

Re: The directory name is invalid - Portable Device

Posted: 21 Dec 2015 17:12
by admin
Thanks for the notes. Will come in handy when I (ever) come back to PD development.

"small" fix: I'm not even responsible for the copying, it's all going on behind the scenes. So I cannot fix it.