[wp-hackers] Problem with wp_uploads_dir();

Philip M. Hofer (Frumph) philip at frumph.net
Wed Sep 1 11:38:20 UTC 2010

I'm using wp_uploads_dir(); now to check the paths to which file directories to use as I assume this is the proper way to do it so that my code knows which directories either standalone or MS to use.

The problem is that on hosting services that require ftp_method to be used, when it comes to the media uploader the wp_uploads_dir() goes in and tries to create the 2010/month/  directory, and if it fails, the wp_uploads_dir() returns back a failure, which then the paths are not found and it screws up the code i'm using to find the paths since it's returning an error and not the paths (even though the paths are still legit) just the one for the month directory couldnt be created.

Is there an alternative that I should be using that wp_uploads_dir() uses but one that doesnt return the error instead of the other paths ?

Or is that a bug where its returning the error and not the paths AND the error ?

- Phil

More information about the wp-hackers mailing list