Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

upload a file


Salvo

Recommended Posts

The below code insert everything except the menu_path and the file doesn't upload.. can someone tell me what is missing?

 

case 'insert':

$expires_date = '';

if ($HTTP_POST_VARS['day'] && $HTTP_POST_VARS['month'] && $HTTP_POST_VARS['year']) {

$expires_date = $HTTP_POST_VARS['year'];

$expires_date .= (strlen($HTTP_POST_VARS['month']) == 1) ? '0' . $HTTP_POST_VARS['month'] : $HTTP_POST_VARS['month'];

$expires_date .= (strlen($HTTP_POST_VARS['day']) == 1) ? '0' . $HTTP_POST_VARS['day'] : $HTTP_POST_VARS['day'];

}

tep_db_query("insert into " . TABLE_MENU . " (products_id, menu_title_id, menu_description, menu_date_added, expires_date, status) values ('" . $HTTP_POST_VARS['products_id'] . "','" . $HTTP_POST_VARS['menu_title_id'] . "','" . $HTTP_POST_VARS['menu_description'] . "', now(), '" . $expires_date . "', '1')");

 

//upload a file

if ($menu_path = new upload('menu_path', '../menus')) {

tep_db_query("update " . TABLE_MENU . " SET menu_path= 'menus/" . $menu_path->filename . "' WHERE menu_id = '" . $menu_id . "'");

}

 

tep_redirect(tep_href_link(FILENAME_MENU, 'page=' . $HTTP_GET_VARS['page']));

break;

 

 

 

 

 

This is what I use to browse

 

<tr>

<td class="main"><?php echo TEXT_FILES_NAME ?></td>

<td class="main"><?php echo tep_draw_file_field('menu_path'); ?></td>

<tr>

 

Thanks

 

 

Salvo

Link to comment
Share on other sites

HI all

 

Is there anyone who can help on this one? looks easy but I can't make it work. I can't upload a file and instert the extention in the field (file.doc)

 

Help would be appreciated

 

Salvo

Link to comment
Share on other sites

I try again, :-(

 

Is there anyone willing to help to create this contribution?

 

I need to upload a file and insert the ie. document.pdf into the field menu_path

 

How do I do it?

 

Thanks and sorry if I keep asking but I have been spending lots of time without success..

 

Salvo

Link to comment
Share on other sites

Maybe Tuesday will bring me luck and find someone willing to help...

 

Pleaseeeee. I have already had two weeks of sleepless nights about this..

 

Thank You

 

Salvo

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...