Paths should be relative for images and uploads
|Reported by:||ryanscheuermann||Owned by:||ryanscheuermann|
|Component:||Upload||Keywords:||upload, migration, has-patch, needs-testing|
I don't know about anybody else, but this annoys the people who migrate WP installs from one server to another. The current code for uploading files stores the absolute path to the file in the database (postmeta) when it's possible to just store the relative path.
The way it is now, the code serializes an array into the database, and when migrating, you have to update the byte counts in the DB for the uploads to display on the new server. By using relative paths off the ABSPATH variable, this is unnecessary.
I've attached a patch, but it needs serious testing.
Change History (35)
comment:21 @foolswisdom — 8 years ago
- Keywords has-patch needs-testing added; bg|has-patch bg|needs-testing removed
- Summary changed from Remove db store of absolute path for uploads to Paths should be relative for images and uploads
comment:24 @markjaquith — 8 years ago
- Priority changed from normal to high
- Severity changed from normal to major