Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Admin Web Access to Customer Image Uploads?

    Admin Web Access to Customer Image Uploads?

    I see that the images/uploads directory is block http access, which makes sense as you wouldnt want anyone access these files.

    however, Is there a way I can set it up so that my client can access the files through web interface if logged into the admin area?

    I really want to simplify this for her and potentially make a custom code that adds a clickable link on the order page which will either display or download the image for the order.

    Can anyone suggest anything I can do?

    Thanks

    Phil
    Phil Rogers
    A problem shared is a problem solved.

  2. #2
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Admin Web Access to Customer Image Uploads?

    I just found this example:

    PHP Code:
    <?php
    $file 
    'monkey.gif';

    if (
    file_exists($file)) {
        
    header('Content-Description: File Transfer');
        
    header('Content-Type: application/octet-stream');
        
    header('Content-Disposition: attachment; filename='.basename($file));
        
    header('Content-Transfer-Encoding: binary');
        
    header('Expires: 0');
        
    header('Cache-Control: must-revalidate');
        
    header('Pragma: public');
        
    header('Content-Length: ' filesize($file));
        
    ob_clean();
        
    flush();
        
    readfile($file);
        exit;
    }
    ?>
    I am going build a link which will use GET to pull the order id, then from this I will select the image from the attribute on the order.

    then I will strip the image filename back to the unique number for the file that exists on the server, which I will then chuck into the above code, and hopefully this will work :)

    I will post back if its a success, in the mean time if anyone has any better suggestions please let me know.

    Ta

    Phil
    Phil Rogers
    A problem shared is a problem solved.

  3. #3
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Admin Web Access to Customer Image Uploads?

    OK here is my solution. i've taken a more simplistic approach.

    I have added this to admin/orders.php:

    HTML Code:
    <div style="width:400px; padding-bottom:20px;">
    <h3>Order Image Downloads</h3>
    <form target="_blank" action="download.php" method="post">
    Enter the image file name, for example <strong>2.jpg</strong> if the uploaded files shows as <strong>2. Myimage.jpg</strong> on the product option line. Then click submit to download.
    <br />
    <input type="text" name="fname" />
    <input type="Submit" name="Submit">
    </form>
    </div>
    and then uploaded a file called download.php to the admin directory with this code:
    PHP Code:
    <?php 
    $number 
    $_POST["fname"]; 
    $file '/home/yourpath/public_html/images/uploads/' $number;
    if (
    file_exists($file)) {
        
    header('Content-Description: File Transfer');
        
    header('Content-Type: application/octet-stream');
        
    header('Content-Disposition: attachment; filename='.basename($file));
        
    header('Content-Transfer-Encoding: binary');
        
    header('Expires: 0');
        
    header('Cache-Control: must-revalidate');
        
    header('Pragma: public');
        
    header('Content-Length: ' filesize($file));
        
    ob_clean();
        
    flush();
        
    readfile($file);
    exit;
    }
    ?>
    Hope this helps anyone else with the same requirements and if anyone spots any mistake or potential problems doing it in this way please let me know :)
    Phil Rogers
    A problem shared is a problem solved.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Admin Web Access to Customer Image Uploads?

    Thanks for posting your solution to this issue ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: Admin Web Access to Customer Image Uploads?

    It sounds like you've got a solution; there's also the Customer Uploaded Files plugin: http://www.zen-cart.com/downloads.php?do=file&id=1134

  6. #6
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Admin Web Access to Customer Image Uploads?

    Quote Originally Posted by lat9 View Post
    It sounds like you've got a solution; there's also the Customer Uploaded Files plugin: http://www.zen-cart.com/downloads.php?do=file&id=1134
    ah man how did I not find this!!! lol
    Phil Rogers
    A problem shared is a problem solved.

 

 

Similar Threads

  1. Customer Image Uploads ?
    By JayC in forum General Questions
    Replies: 42
    Last Post: 10 Nov 2010, 05:38 PM
  2. Cannot access Customer within Admin
    By imiq in forum General Questions
    Replies: 1
    Last Post: 13 Jul 2010, 12:24 PM
  3. Can price be changed after Customer Uploads an Image?
    By inetmarketing in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 25 Aug 2009, 01:43 AM
  4. Customer access to ZenCart Admin
    By rooisnor in forum General Questions
    Replies: 3
    Last Post: 8 Oct 2008, 05:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR