[wp-hackers] Uploading Files with a Plugin

Mohammed K. al-Safi msafi at msafi.com
Tue Feb 10 10:09:10 GMT 2009


Yep, that worked!

Full thanks to you, Benedict!

Mohammed al-Safi


On Tue, Feb 10, 2009 at 1:35 PM, Benedict Eastaugh <ionfish at gmail.com>wrote:

> What's wrong with just using get_option('upload_path'); ? It doesn't
> need to be appended to ABSPATH, as it's based on the WP_CONTENT_DIR
> constant; that's why you're getting those paths, because it's
> appending one absolute filesystem path to another.
>
> 2009/2/10 Mohammed K. al-Safi <msafi at msafi.com>:
> > Hi,
> >
> > I'm trying to allow users to upload a CSV file through a plugin, take
> that
> > CSV file and parse its content into the database. I can't figure out how
> to
> > get the plugin to manage the file upload. I think the only folder which
> the
> > plugin has permission to upload to is the upload folder that is specified
> in
> > the settings. I tried to use *ABSPATH.get_option('upload_path'); *to get
> the
> > location of that folder, but this is returning something funny like: *
> >
> C:\xampp\htdocs\wordpress/C:\xampp\htdocs\wordpress/wp-content/uploads*(local
> > WordPress installation using XAMPP).
> >
> > Anyone know what's happening here and how to get the upload path
> correctly?
> >
> > Alternatively, if you know of an up-to-date plugin that accepts user
> uploads
> > and does something with them, I could perhaps just take a look at their
> > code...
> >
> > 50% thanks in advance.
> >
> > Best,
> >
> > Mohammed al-Safi
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list