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

  • Home
  • SEARCH
  • 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 7569943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:17:35+00:00 2026-05-30T15:17:35+00:00

I am using this code to upload files, but when I upload a file

  • 0

I am using this code to upload files, but when I upload a file to one folder it works , but when I want to upload a file to folder inside a folder, it doesn’t work ,, as in the following code ..

   $imageFile = $_FILES['origialImg']['tmp_name'];
            $filename = basename( $_FILES['origialImg']['name']);
            if(strstr($_FILES["origialImg"]["type"],"image")){
        list($width, $height) = getimagesize($imageFile);

        $src = imagecreatefromjpeg($imageFile);
        $orig_h = ($height/$width)* $orig_w;

        $tmp = imagecreatetruecolor($orig_w, $orig_h);
        imagecopyresampled($tmp, $src, 0,0,0,0,$orig_w,$orig_h,$width,$height);
        imagejpeg($tmp, $folder1."/".$folder2."/".$filename,100);
        imagedestroy($tmp);
        imagedestroy($src);

edit

yes, this is the error reporting

Warning: imagejpeg(): Unable to open 'images/big/216389_10150266713175744_609155743_9327201_766531_n.jpg' for writing: Permission denied in /var/www/GazaPlaces/account/photos.php 
  • 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-05-30T15:17:36+00:00Added an answer on May 30, 2026 at 3:17 pm

    So it works when you upload a file to a folder but it doesn’t work when you upload a file to a folder in that folder?

    Check the folder exists and that you have permission to upload into it, you can CHMOD the folder using your FTP client.

    To see if the folder is there use: file_exists().
    You can CHMOD the folder using php with chmod().

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

Sidebar

Related Questions

Using this code to zip a folder and it works perfect on small files
hii i am using ajax file upload in this code <script type=text/javascript src=fileuploader.js></script> <script
I am using this PHP code: if (isset($_GET['c'])) { $pages = array(home, upload, signup);
Firstly, I'm not asking how to perform a multi-file upload using CodeIgniter, but rather
i'm using Valums Ajax uploader. all works great in Mozilla with this code: View:
I am initializing file upload using the following HTML: <form enctype=multipart/form-data action=PHPScripts/upload.php method=POST> <input
I'm attempting to upload a file asynchronously using HTTP POST and jQuery, but I'm
im trying to upload a file using org.apache.commons.fileupload. but i dont no, what mistake
I'm using a flash/ajax file upload in php based on this site - http://blog.codeville.net/2008/11/24/jquery-ajax-uploader-plugin-with-progress-bar/
So I'm using Codeigniter and I want to upload files. It's working fine except

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.