Jump to content



Photo
- - - - -

Cannot Upload Files when editing products


This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1   nsquared

nsquared
  • Members
  • 5 posts

Posted 27 July 2012 - 22:33

This is a weird one. I can upload images for a product and they appear in the store, but this I added the ability to upload images for a report. When you go to update the product it shows that it is uploading but at the preview you get the message "[img]https://lakehavasumotorcyclesales.com/admin/images/icons/warning.gif[/img] No new file uploaded."
Like I said, the product images will upload, but the report file will not. This code works perfectly fine on a different server where the store use to be. I have moved it to a new host. Here is the code for the image upload:
if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {
$sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);
}

And here is the code for the report upload:


// BOF: Inspection Report Upload
if (isset($HTTP_POST_VARS['products_inspupload']) && tep_not_null($HTTP_POST_VARS['products_inspupload']) && ($HTTP_POST_VARS['products_inspupload'] != 'none')) {
$sql_data_array['products_inspupload'] = tep_db_prepare_input($HTTP_POST_VARS['products_inspupload']);
}

//add delete inspection report function
if ($HTTP_POST_VARS['delete_insp_1'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_inspupload']);
$sql_data_array['products_inspupload'] = tep_db_prepare_input($HTTP_POST_VARS['none']);
}
//end delete incpection report function

// EOF: Inspection Report Upload

Confirmed all fiels exist in database. Any suggestions would be much appreciated, I am desperate at this point!

#2   nsquared

nsquared
  • Members
  • 5 posts

Posted 30 July 2012 - 03:21

Any help would be appreciated, even if I can hire a consultation, I just can't see where it is broken. Also, after I hit preview, it give the Uploading display and counts up to 100%, but at the preview screen there is the No New Files Uploaded message.

#3 ONLINE   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,014 posts

Posted 30 July 2012 - 03:37

You're apparently using an old version of osCommerce as that code does not match the current version. All I can remember about that old code is:

1. Make sure that the form that posts the image includes 'enctype="multipart/form-data"'

2. The directory the images are being saved to needs the same permissions as the regular images directory (If you're using a different directory.)

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#4   nsquared

nsquared
  • Members
  • 5 posts

Posted 30 July 2012 - 15:10

Thank you very much for your response. The reports are saving to the same directory as the images, so the permissions are correct. I did verify that 'enctype="multipart/form-data"' is used on all the forms. Since this works fine on a different server that I think is running PHP4, and this server is on PHP 5, could that be it?