Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8993357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:10:38+00:00 2026-06-15T23:10:38+00:00

I have a problem that I don’t know how to solve. Let me explain

  • 0

I have a problem that I don’t know how to solve. Let me explain it…

Directory structure:

-/public_html/lab/
-/public_html/lab/upload.php
-/public_html/lab/plugins/

I am really newbie with php+ftp, but I have the idea that FTP does not use “absolute root path” (/home/user/public_html/), instead it use “absolute user path” according to the user in question (/public_html), right?

Well, in the upload.php I have the code where the FTP class take a file temporally stored at the same folder where upload.php reside (/public_html/lab/) and then try yo move it to /public_html/lab/plugins/ folder.

FTP class receive a path where you want to move the file. But, I don’t want to pass the path like absolute, I want to avoid this:

ftp->move('the-file.zip', '/public_html/lab/plugins/');

I would like to do something like this:

ftp->move('the-file.zip', '../plugins/');

But the code above looks like is not valid. So, how can I reproduce that result?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:10:39+00:00Added an answer on June 15, 2026 at 11:10 pm

    Rather than FTP which is designed for communication between two different hosts, consider moving the file via move_uploaded_file in upload.php:

    move_uploaded_file($_FILES['uploaded']['tmp_name'],'./plugins/'.$_FILES['uploaded']['name']);
    

    Once the file is uploaded via the PHP script, the temp file will be available in the _FILES superglobal under $_FILES[$inputFieldName][‘tmp_name’]. If you’re using the example I gave, make sure to clean the "name" attribute before, since it will allow for client-side injection and leave a huge security hole in the application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem, that i don't know how to solve it. i have
I have a problem that I don't know how to solve. I have have
I have a slight problem that I don't know how to solve. Could you
I have a little problem that I don't know how to solve. Ajax validation
So I have a problem that I don't really know how to go about.
Let's say we have two concave 2d polygons(A, B), that don't intersect. The problem
I have a small problem that I don't know how to deal with. I've
I have a weird problem that I don't fully understand how to solve. Could
I got this problem that I can't just solve algorithmically. Let's say i have
I have problem that I don't seem to be able to solve. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.