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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:16:41+00:00 2026-05-25T12:16:41+00:00

Hy , i was looking at uploadify.php and did’n understand a thing. I have

  • 0

Hy , i was looking at uploadify.php and did’n understand a thing.

I have a form like this :

<form id="formid" name="upload_pic" action="upload.php">
<select name="product_id">
<option value="1">Apples</option>
<option value="2">Oranges</option>
... etc
</select>
<input id="file_upload" name="file_upload" />
</form>

and my uploadify settings are :

<script type="text/javascript">
$(document).ready(function() {
  $('#file_upload').uploadify({
    'uploader'  : 'uploadify/uploadify.swf',
    'script'    : 'uploadify/uploadify.php',
    'cancelImg' : 'uploadify/cancel.png',
    'folder'    : '../images/level3/tabv_all/tab_header/',
    'auto'      : false,
    'multi'     : true,
    'fileExt'     : '*.jpg',
    'fileDesc'    : 'ONLY JPG (.JPG)',
    'removeCompleted' : false
  });
});
</script>

What i want to do is that if the user select Apples wich has the id=1 and browse for a file like Tasty_apples.jpg -> the uploaded file to be renames to product@1@Tasty_apples.jpg and then to be inserted in mysql like that?

The main question is how to add the extra product@id@ to a file based on a <select><option> value ?

Thank you very much

The uploadify.php is this :

if (!empty($_FILES)) {
    $tempFile = $_FILES['Filedata']['tmp_name'];
    $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
    $targetFile =  str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];

    move_uploaded_file($tempFile,$targetFile);
    echo str_replace($_SERVER['DOCUMENT_ROOT'],'',$targetFile);
}
  • 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-25T12:16:42+00:00Added an answer on May 25, 2026 at 12:16 pm

    You can send additional data to your backend script with scriptData option:

    http://www.uploadify.com/documentation/options/scriptdata/

    Example

    var selectedID = $("select[name=product_id]").val()
    
    'scriptData'  : {'pid': selectedID}
    
    // uplodify.php
    $targetFile =  str_replace('//','/',$targetPath) . 'product@' . $_POST['pid'] . '@' . $_FILES['Filedata']['name'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking at this for several days now with no success. I
I am looking to use a PHP library for uploading pictures to a web
Looking to do a very small, quick 'n dirty side project. I like the
I'm looking for a right-click upload application like RightLoad - an application that can
I am looking for a file uploader similar to uploadify with progress bar that
Update: I have now written a PHP extension called php_ssdeep for the ssdeep C
I'm looking for a way to get the form parameters of a HTTP multi-part
I have not used PackedArray before, but just started looking at using them from
This should a quick question for some easy rep. I'm doing some PHP Website
I have been using PHP for years. Lately I've come across numerous forum posts

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.