News:

Support the VirtueMart project and become a member

Main Menu

Media File save Infos

Started by Micha70, January 19, 2017, 03:26:21 AM

Previous topic - Next topic

Micha70

Hello,

when I create a new media file, I want to save information about the related product in a separate table.
In the mediahandler.php I read the product ID and the product name from the db. With a own function this information (Product-ID, Productname, File Title, Media id) is to be written into my table by clicking on the Save button.

This function I have integrated within the mediaHandler function processAction ($ data) in 'upload', 'replace' etc.

However, only the file_title is stored in the table when 'uploading' a new file. Media id, Product-ID, Product-Name are always empty or 0. All information seems to be lost.
Also with $ _POST or session this information is lost when saving.

Only the media_action 'replace' is used to store the media_id. For this, however, the media file must already exist. And is in my table then again created, since there is this id not yet.

Why does the media handler discard all my values when saving?

Milbo

I use this to catch the upload


$media = vRequest::getFiles('upload');


the information is then directly processed. Maybe it is still in the Request, but I never tried that.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/