Jump to content
Sign in to follow this  
iiinetworks

[CONTRIBUTION] File uploads as an Option Feature

Recommended Posts

I have been getting the same Error: Destination does not exist error. I followed all the previous posts to make sure the spelling was correct, etc. I chmod'd the directory to 777, but still to no avail.

 

The even weirder thing is that as part of debugging I changed the directory to use the same one I use from the Admin screen when upload product images and I still get the Destination does not exist error.

 

Any clues?

 

Thanks!

Dionn

Share this post


Link to post
Share on other sites

Please disregard my post. Turns out my service provider changed servers on me so my path was wrong!

 

Love the contribution!

Share this post


Link to post
Share on other sites

How easy would it be to alter this code for another area?

 

We have a requirement for customers to upload .doc files

 

This would be in an area not conected to products.


No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites
This would be in an area not conected to products.

If it is not connected to products, I would skip this module and start from the admin/includes/classes/upload.php. You can see two ways to use it in admin/categories.php.

 

Hth,

Matt

Share this post


Link to post
Share on other sites

Thanks for the insite Matt, I will go to work on that.

 

The idea is to have the upload area in the website, so I take it that this mod would need to then be integrated across from the admin side


No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites

Essentially, this contribution melds the upload class from admin with Chandra's Option Type Feature contribution. What I did is I copied the upload class from admin to catalog and modified it. You may not have to modify it at all. Just add a tep_draw_file_field where you want it, change tep_draw_form to use the 'enctype="multipart/form-data"' parameter, and do a

$doc_file = new upload(DIR_FS_DOC_FILES);

to catch the result. If you need to rename the files on upload, it would get a little more complicated.

 

The code from this contribution that would be relevant to you would be in product_info.php and includes/application_top.php. Note: as I said above, the modifications that I made to the upload class were to accomodate the way attributes are passed. If you look at this code, you will need to ignore them, as they won't help you.

 

Hth,

Matt

Share this post


Link to post
Share on other sites

I have gone through the steps and set up a file upload to my store. I browse - upload and during checkout - i see that it has called it something like /tmp/php32i3to but honestly - i dont know where to find that - or even if i have that file???

 

Can you tell me how and where to find it?

 

thanks in advance.

Share this post


Link to post
Share on other sites

/tmp/php{whatever} is an error. Is your store publicly available that I could try a test order? Are you using the latest version of the contribution (.77, topmost links on the contribution page).

 

Thanks,

Matt

Share this post


Link to post
Share on other sites

Thank you for this contribution :D

 

I would like to combine this contribution: Attributes option type selection

 

includes quantity discounts, minimum number of products order, and conditional option (option1 linked with option2, if you select option1, option2 is automatically selected)

 

 

 

With your File Upload .7 (for PA - Option Type Feature)

 

Do you think it is possible?

Share this post


Link to post
Share on other sites

I am trying to set up this File Uploads contribution to coexist with the Options as Images (OAI) mod (http://www.oscommerce.com/community/contributions,1467).

 

However, because OAI takes over the drawing of the attribute controls, it displays all non-image attributes as drop down boxes instead of the appropriate control.

 

What appears to be needed is to bring the functionality of the File Uploads/Option Types lines in "product_info.php" into Options as Images file "options_images.php".

 

Or as another approach, perhaps the image attribute type could be added to the Option Types functionality of this contribution.

 

Has anybody done either of these? Any suggestions?

 

P.S. This is on osc2.2ms2


Rule #1: Without exception, backup your database and files before making any changes to your files or database.

Rule #2: Make sure there are no exceptions to Rule #1.

Share this post


Link to post
Share on other sites

Did anyone come across the problem that when trying to upload the image it gives the following error :

 

Error: destination does not exist.

 

I checked everything as many times possible .... and I have everything as instructed ....

 

Thanks for the help

Share this post


Link to post
Share on other sites

Thank you!

 

I tried searching, but perhaps I am not using the correct syntax. I will make sure I learn it.

 

Thanks again!

Share this post


Link to post
Share on other sites

hi Matt, thats a great contribution and its working just great .... however I was wondering is it possible that after the customer upload the image they can view the image what they have uploaded ... do you think its possible .....

 

THanks

 

Ali

Share this post


Link to post
Share on other sites

You would have to make two modifications to the code:

 

1. You would need to retain the extension info, so the browser would know what image it is.

 

2. You would need to change the shopping cart and/or product info pages to display the image.

 

Hth,

Matt


Always back up before making changes.

Share this post


Link to post
Share on other sites

There are instructions for that somewhere (maybe in the HTML file that comes with the distribution? I remember writing them...). Basically, you change the code in includes/application_top.php to save the file as something like 1-imagename.ext rather than 1 (where 1 is the files_uploaded_id). You want to leave the files_uploaded_id so that you don't get conflicts between different images that happen to have the same name (the original version of the contribution overwrote the images in that case).

 

Hth,

Matt


Always back up before making changes.

Share this post


Link to post
Share on other sites

Thanks Matt ... I tried looking for the HTML file, and it doesnot seem to be included in it, do you think you can send me ... as I am having a hard time with it ... thank you again so much for your help ......

Share this post


Link to post
Share on other sites

Hello, I am installing Upload option and I am getting this

 

Error: destination (/hsphere/local/home/mosaic/mosaicartkeepsakes.com/catalogimages/uploads/) does not exist.

 

and I read Matt coments on it i.e.

 

Add a trailing / to the DIR_FS_CATALOG definition

 

I am not sure what does trailing means here ... can some one help me ....

 

The parameter I have to change is

 

define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);

 

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×