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 7050499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:09:03+00:00 2026-05-28T03:09:03+00:00

How to upload images in web context (frontend) without reloading the page in modx

  • 0

How to upload images in web context (frontend) without reloading the page in modx revolution? I am trying to use fileupload extra for uploading images but it is reloading the page. Can anyone help me, please?

  • 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-28T03:09:04+00:00Added an answer on May 28, 2026 at 3:09 am

    finally i got the answer. we can do it without using FILEUPLOAD addon by using the simple php code and a small javascript..
    php code:-

    <?php
    
    $path = "uploads/";
    
    $valid_formats = array("jpg", "png", "gif", "bmp","jpeg");
    if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST")
    {
    $name = $_FILES['photoimg']['name'];
    $size = $_FILES['photoimg']['size'];
    if(strlen($name))
    {
    list($txt, $ext) = explode(".", $name);
    if(in_array($ext,$valid_formats))
    {
    if($size<(1024*1024)) // Image size max 1 MB
    {
    $actual_image_name = time().".".$ext;
    $tmp = $_FILES['photoimg']['tmp_name'];
    if(move_uploaded_file($tmp, $path.$actual_image_name))
    {
    
    echo "image uploaded";
    }
    else
    echo "failed";
    }
    else
    echo "Image file size max 1 MB";
    }
    else
    echo "Invalid file format..";
    }
    else
    echo "Please select image..!";
    exit;
    }
    

    for other javascript and all u can refer the below link:-
    http://www.9lessons.info/2011/08/ajax-image-upload-without-refreshing.html

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

Sidebar

Related Questions

hai guys, I want to upload images through my web page to a folder
I need to upload images using FileUpload without postback(using Ajax).I tried many examples.But in
I'm trying to use the Picasa Web Uploader API to upload galleries of photos
I have a web application in which a user has to upload images to
I'm developing a Web application that will let users upload images. My concern is
Let say, I have a web application that allows users to upload images and
I use an HttpHandler to dynamically serve images in a ASP.Net web application. I
I'm developing a web app which allows users to upload images. Instead of forcing
I'm writing a web application where users can upload images. I wonder what's the
I'm working on an iPhone app that will upload images to a web server.

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.