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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:38:45+00:00 2026-05-16T11:38:45+00:00

i need to mimic how an upload form work. i need to store a

  • 0

i need to mimic how an upload form work. i need to store a file into database and uploads the $_FILES into our folders. The problem every bit of code of the models and the form itself is based on legacy code. I don’t have the the gut to strip all code and start over. I prefer to let it be

So, my goal is how to uplaod file without use the previous form and then only serialize/unserialize an object consist of filename and url. while the file itself have been story via copy function and not uploads form.

  • 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-16T11:38:46+00:00Added an answer on May 16, 2026 at 11:38 am

    The only critical part of the $_FILES array for any particular request is the ...['tmp_name'] portion, since that points to where PHP saved the uploaded file. Save a copy of a $_FILES that’s set up the way you want to test (with however many files you want), then manually change the tmp_name to point to actual files on your server, rather than the random garbage names that PHP autoassigns to uploads, and you could be able to reuse a copy of the data as many times as you want, as long as your scripts don’t move/delete/munge the files you’re pointing at.

    So, something like:

    $_FILES['file1']['tmp_name'] = '/path/to/file/to/test/with';
    $_FILES['file2']['tmp_name'] = '/some/other/path/or/file/for/testing';
    
    $savedfiles = serialize($_FILES);
    

    and then you can stick a

    $_FILES = unserialize($savedfiles);
    

    wherever it’s appropriate for testing your app.

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

Sidebar

Related Questions

I'm essentially planning to mimic the comment functions on PDF files, but online. That
I am having trouble getting server variables remotely in VB .Net I need to
I'd like to mimic a particular behavior of spreadsheets with SlickGrid. The user: clicks
Is there a way to mimic the native transition and functionality of sliding entire
I'm try out a few game mechanics and I tried to mimic WoW's periodic
When a user submits without any boxes checked. I need my ODM (Mongoid) to
I don't know why I never found myself having to use a debugger to
Actually I intended to ask the following question: For an executable that lies in
I'm trying to use .NET 4's SortedSet<T> collection. It seems to have everything I
I have a JavaScript overlay that consists of several input text search criteria. When

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.