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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:53:04+00:00 2026-06-11T17:53:04+00:00

I am uploading three files using Zend Element File. I am uploading and renaming

  • 0

I am uploading three files using Zend Element File. I am uploading and renaming the files. Now the problem is that when uploading same extension, it generates error of

Zend_Filter_Exception: File 'D:\wamp2\tmp\php2443.tmp' could not be renamed. It already exists.

For example if in first file I upload file of extenstiono .txt in second I upload .docx and in third I again select .txt or .docx, It will generate the above given error.

But If I select three different extensions, every thing goes best. I am using the following code

  if ($form->med_file_1->isUploaded()) {

    $originalFilename = pathinfo($form->med_file_1->getFileName());

    $newFilename = time() . '.' . $originalFilename['extension'];
    $form->med_file_1->addFilter('Rename', "application_data/uploaded_files/patients/" . $newFilename,$originalFilename['basename']);
    $form->med_file_1->receive();

}

 if ($form->med_file_2->isUploaded()) {

    $originalFilename = pathinfo($form->med_file_2->getFileName());
    $newFilename = time() . '.' . $originalFilename['extension'];
    $form->med_file_2->addFilter('Rename', "application_data/uploaded_files/patients/" . $newFilename,$originalFilename['basename']);
    $form->med_file_2->receive();

}

    if ($form->med_file_3->isUploaded()) {
                $originalFilename = pathinfo($form->med_file_3->getFileName());
                $newFilename = time() . '.' . $originalFilename['extension'];
                $form->med_file_3->addFilter('Rename', "application_data/uploaded_files/patients/" . $newFilename,$originalFilename['basename']);
                $form->med_file_3->receive();

    }
  • 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-11T17:53:06+00:00Added an answer on June 11, 2026 at 5:53 pm

    The reason for the error is because you are naming each uploaded file:

    time() . '.' . $originalFilename['extension'];
    

    The call to receive() happens so fast that time() returns the same value on each call so you can end up with duplicate file names. You just need to generate a more unique name for each file. Something like the following should work:

    md5(uniqid(time(), true)) . '.' . $originalFilename['extension'];
    //or
    $originalFilename['basename'] . '_' . time() . '.' . $originalFilename['extension'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sometimes, when uploading files using <input> tag, I encounter problem where the file extension
I'm using Request.Files to obtain a file that the user is uploading on my
I am using uploadify and my problem is that the files are not uploading.
Very strange (to me) problem when uploading files to a server using ASIFormDataRequest. When
I'm implementing file uploading using Richfaces version 4.0. I've noticed, that there is quite
I'm using plupload to make an ajax file uploading. Now the plupload.Uploader class has
I am using the tag for uploading multiple files with php. I notice that
I'm uploading files using php. The file has to be below a certain size.
I am uploading files using jQuery uploadify plugin. All files are uploaded into same
i'm uploading these files in apache, using php. is there any best way to

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.