simonzebu Posted June 7, 2005 Posted June 7, 2005 Hi All, My client wants to have a sample mp3 file for each product in addition to the image. I have created a field called products_soundfile in the products table and added duplicate chunks of code in categories.php wherever products_image appeared, changing the duplicate bits to products_soundfile. I now have an extra upload bit in the admin for uploading an mp3 file. It appears to work in that the filename is written to the database but I get an OScommerce error 'Warning: No file uploaded', and sure enough it is not uploaded. I figure the problem has to be in upload.php but I cannot see where I would need to alter the code to get the file to upload. I have done several searches but cannot find any posts about second images, any clues anyone?
♥Vger Posted June 7, 2005 Posted June 7, 2005 Um??? Why didn't you just create a folder called something like 'samples' and upload all of your samples to there, and then just provide a link to it within the Product Description box (when you add the product), or use the Products URL box? Vger
simonzebu Posted June 7, 2005 Author Posted June 7, 2005 Um??? Why didn't you just create a folder called something like 'samples' and upload all of your samples to there, and then just provide a link to it within the Product Description box (when you add the product), or use the Products URL box? Vger <{POST_SNAPBACK}> Hi Vger, Thanks, but the client needs to be doing all the uploading of new products himself as and when they are launched. I have worked out the problem. I had added another case in categories but this worked: // copy image only if modified $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES); if ($products_image->parse() && $products_image->save()) { $products_image_name = $products_image->filename; } else { $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : ''); } $products_soundfile = new upload('products_soundfile'); $products_soundfile->set_destination(DIR_FS_CATALOG_IMAGES); if ($products_soundfile->parse() && $products_soundfile->save()) { $products_soundfile_name = $products_soundfile->filename; } else { $products_soundfile_name = (isset($HTTP_POST_VARS['products_previous_soundfile']) ? $HTTP_POST_VARS['products_previous_soundfile'] : ''); } break; along with the other changes mentioned.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.