Ah, wp_upload_dir() is the problem then.