Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2013
    Location
    Calgary AB,Canada
    Posts
    55
    Thanks
    28
    Thanked 1 Time in 1 Post

    Document/Image Maintenance.

    Hi,

    I am new to web development (6 months only). Just crossed from the old IBM iSeries to web development.

    I have been given a task to write a PHP/HTML/JavaScript program for document/image maintenance. Its like uploading an image/document(pdf/doc) to the ftp site and removing/deleting an image/document(pdf/doc) from the web server and displaying of images/documents (not the entire image, just icons like of the windows file explorer).

    Can you please give me an idea how I can go about it. I know PHP/HTML/JS programming (basic - intermediate level). Or if you guys know any existing site, where I can have a look.

    thanks,


    Isaac

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    A little ambiguous.
    You want the code to copy a document from the webserver (where the PHP is executing), to an ftp server, delete the existing document from the webserver and capture the new link location correct?
    Yes, that's certainly doable. PHP has an ftp/sftp and ssh libraries available for connections. Creating icons will probably require you to use the GD or imagemagik libraries to create one.
    Then you'd simply take a dbms or even a file, and reference the name, image, and new location for it. Iterate that and build the links you need.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • Users who have thanked Fou-Lu for this post:

    Isaac Sureshkum (09-19-2013)

  • #3
    New Coder
    Join Date
    Jun 2013
    Location
    Calgary AB,Canada
    Posts
    55
    Thanks
    28
    Thanked 1 Time in 1 Post
    Thanks Fou-Lu.

    I am sure, I did not make it clear in my question. What I want is, think of a WordPress site, where the user uploads and maintains images in the image gallery....

    I want to do that similar maintenance program.

    thanks,

    Isaac

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Oh just user type galleries?
    It's even easier than that. I wouldn't recommend any direct FTP connections for a user (as that's beyond the scope of php), but uploading is a relatively trivial part of PHP.
    Once you have the file, you move it using the move_uploaded_file function in PHP on the local server. I'd still use a dbms for this, as you can then link the file, named whatever you want it to be (randomized the better since you can just dump everything in the same path or split the path up from the characters), and associate a user, path, display name, and other meta details from the file into the dbms.

    Aside from this, I'm not familiar with wordpress or what can be done. But since wordpress is written in PHP, I can guarantee you that PHP can do it :]
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •