Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have uploaded some files (images) which I'd like to link in my own site as well as other places, but usually I try to host a different resolution of the same image to show up on other sites. My problem with wordpress right now is that if I upload the file to Wordpress' upload directory through FTP, I don't see the file show up in my media (in WP-admin). I can get a link from my ftp client (cyberDuck) but it doesn't actually link me to a working link, also the link is something like this:

http://ftp.mydomain.com/really-link-file-name-with-20%-and-at-the-end-its.jpg

So I assume it works like that b/c it contains jpg at the end but it doesn't work and takes me to a 404 page. Any ideas of how I can go about uploading through an FTP client and get those files to show up on wordpress and also link correctly?

share|improve this question

5 Answers 5

up vote 8 down vote accepted

If I upload the file to Wordpress' upload directory through FTP, I don't see the file show up in my media (in WP-admin)

Try to avoid directly uploading via FTP. WordPress doesn't scan your uploads folder for new images. Instead, use the built-in media uploader within WordPress to upload images. WordPress will automatically place them in the correct folder, create downsized versions you can use in a quick gallery or client sales page, and store the image's meta information in the WordPress database.

The Media Gallery pulls its information from the WordPress database, so to see your uploaded images here, this is the only way to do it!

I can get a link from my ftp client (cyberDuck) but it doesn't actually link me to a working link

Your client is giving you an FTP link. If you use an FTP link in a web browser like Internet Explorer (i.e. ) your browser will act like an FTP client and try to download the image rather than displaying in in the browser. What you need is an actual HTTP link, which you can get from WordPress if you uploaded through the Media Gallery.

If you uploaded directly via FTP, your link would still be something like http://www.mydomain.com/wp-content/uploads/2010/11/something-something.jpg if you uploaded to the /wp-content/uploads/2010/11/ directory. If you put it somewhere else, change the link accordingly.

To Review

The correct way to add images to WordPress and get the links is through the Media Gallery:

  1. Log in to WordPress
  2. Go to Media » Add New
  3. Select your image and upload it to WordPress
  4. Set meta data as appropriate (Title, Caption, Alt Text, Description)
    • If necessary, you can Edit the image as well (rotate, crop, scale)
  5. Highlight the File URL and copy-paste it somewhere where you'll remember it. This is the URL to the full-size image that you can link to from other places.
share|improve this answer
    
The reason I was using FTP was because there's no limit on the file size...wordpress/my webhost puts a 24mb limit on files –  Muhammad Usman Nov 14 '10 at 1:33
1  
Can you add / modify a file called php.ini on your server? If your host provider gives you access to that file, you will be able to change the 24Mb upload limit to whatever you need, and then, as many suggest here, upload your files through Wordpress' Media uploader –  Sergio Majluf Dec 30 '10 at 23:13

"Add From Server" plugin might do what you want. It can scan a folder of files on the server and copy those files to the Wordpress upload folder without having to go through the Media Uploader.

http://wordpress.org/extend/plugins/add-from-server/

share|improve this answer

What's with that url? Its possible but confusing, did you install wordpress on a sub-domain named ftp or redirect the media folder to point there?

Use ftp: //ftp. mydomain.com/whatever.jpg

Or http:// www. mydomain.com/whatever.jpg

The easiest way is to just log into wordpress-->click Media-->upload a photo and copy the direct url to the image.

share|improve this answer

Two separate issues here:

  • in your FTP client you see [part of] real directory structure of your server, but your site works like web server sees it (focuses on site's root directory, not server's). To get working link you need to upload files in directory available to web server and use path relative to site root in URL;

  • files uploaded directly are not picked up by WP media library. For that to happen you need either use WP media upload functionality or import media using some plugin that can do that (I only remember W3 Total Cache by name, that does that for better CDN support functionality).

share|improve this answer

WordPress has the ability to automatically resize images you upload and will keep the different resolutions in the uploads directory. So instead of uploading different resolutions of the file through ftp, I would upload the original resolution of the file and let WordPress create the different sizes you need.

By default, WordPress will store 4 image sizes: thumbnail, medium, large, and original. You can define these sizes in the admin under Settings -> Media. If you need more sizes than that, you can define more in a plugin or in your theme's functions.php by using the add_image_size() function:

add_image_size('my_new_size', $width, $height, $should_crop);

You can find more on this function in the codex: http://codex.wordpress.org/Function_Reference/add_image_size

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.