Jeff,

Thanks for the response. That is not an acceptable solution for us. I had already implemented one hack where I check for a .plist extension because one of my users installed Yahoo Chat which took over plist files that I was downloading and NSURLDownload was turning them into .plist.ychat files. Here is my solution

NSString *extension = [name pathExtension];
NSString *newName = [name stringByDeletingPathExtension];
while(!IsEmpty([newName pathExtension]))
{
        extension = [newName pathExtension];
        newName = [newName stringByDeletingPathExtension];
}

newName = [newName stringByAppendingPathExtension:extension];
// set downloadPath here
[download setDestination:downloadPath allowOverwrite:YES];

That works fine. What is really needed is some switch to turn off the filename modification.

Thanks
Marc

El Oct 21, 2009, a las 2:48 PM, Jeff Johnson escribió:

Hi Marc.

Unfortunately, this is an Apple bug.

What Content-Type does the server return, and can you control that? If so, then you can work around the bug by returning a custom Content-Type that isn't recognized by other applications.

-Jeff


On Oct 21, 2009, at 1:17 PM, Marc Respass wrote:

Hi All,

I have searched and can't find an answer to this. I am using NSURLDownload in an internal application. I connect to a server and download some files. Many times, the file name gets changed. I download file.xslt but the download system turns it into "file.xslt.xml" and then my app can't find it. Is there any way of preventing that?

I modified my download delegate to check for known file types and fix the name but new types are showing up so that's not a good solution. What I am doing now is, in download:decideDestinationWithSuggestedFilename:, to keep checking for an extension and then put the last one back on so I can keep the original filename. That seems kind of hackish but I don't know another way to do it.

Thanks a lot
Marc


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to