New Upload attrubute

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 年 前
I'm having trouble getting the "Upload" attribute to work. I can see the file selector under the product variant. I can select a path the file on the client machine. When I add to basket the code runs to this point

var httpPostedFile = this.Request.Files[controlId];

but httpPostedFile is always null, so the file isn't uploaded.

Have anyone got this working? And can they offer me any advice?

Thanks

Darren
12 年 前
Seems the problem was that I have a themed version of ProductTemplate.VariantsInGrid.cshtml

  @using (Html.BeginRouteForm("Product", new { productId = Model.Id, SeName = Model.SeName }, FormMethod.Post))
  


Needs replacing with

  @using (Html.BeginRouteForm("Product", new { productId = Model.Id, SeName = Model.SeName }, FormMethod.Post, new { enctype = "multipart/form-data" }))
  


Notice: , new { enctype = "multipart/form-data" }

Hope this helps someone else.

Darren
12 年 前
Hi Darren,

mind clarifying something for me? i am working on a plugin that would allow customers to store uploaded files/download them later eg bio/company logo

i came by your post and i assume you are adding a new upload attribute.. would u mind pointing me in the right direction as to how u got about doing this?

did u rework uploadify? or did u write ur own view/controller? or is there a a functionality in the admin interface i could use to achieve this? i have nop2.4
12 年 前
hacknop wrote:
Hi Darren,

mind clarifying something for me? i am working on a plugin that would allow customers to store uploaded files/download them later eg bio/company logo

i came by your post and i assume you are adding a new upload attribute.. would u mind pointing me in the right direction as to how u got about doing this?

did u rework uploadify? or did u write ur own view/controller? or is there a a functionality in the admin interface i could use to achieve this? i have nop2.4


Hi,

I'm using the latest version of the code (downloadable from codeplex) which has upload as an attribure of a product variant.

Hope this helps

Darren
12 年 前
i see the changeset! thanks a lot~
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.