How to stop uploading WFFM media files in Sitecore Media library folder and get byte array of uploaded media file - file-upload

I am using Sitecore V8 + WFFM file upload control.
When user upload the file, it get stores in Sitecore Media library, and I get upload media Item Id in Custom Save action event.
So how I can:-
1.Stop uploading media file into Sitecore Media library folder.
2.Get byte array of uploaded media file so that I can pass byte data to rest service

Typically you will need to create you own 'Upload field' inherited from default wffm FileUploadField and override code responsible for handling posted files. You also might need to add custom form save action if you need to handle additionally this posted file. Also you may use idea from this post.

Related

Example or template on how to do file upload in Google AppMaker

can anyone share with me the .zip file for Document Approval template because I can't open it since I'm not using GCS but I wanted to go through how they using Drive Picker widget to upload file and so on.
another thing is, where the file will be uploaded to? is it the owner's Drive? is it possible to upload the document to a single folder of a Team Drive instead? Really appreciate it if anyone can share with me some thoughts or any API will do, Thanks!
The only way to upload files that App Maker provides out of the box is Drive Picker widget and by default it uploads files to current user's Drive root folder. Drive Picker's API allows to change default upload folder, however App Maker doesn't expose the setting at this time. But it has onPickerInit event that provides you with pickerBuilder that you can use to customize your the picker:
// onPickerInit Drive Picker's event handler
var uploadView = new google.picker.DocsUploadView();
uploadView.setParent('ID of the folder to upload to');
pickerBuilder.addView(uploadView);
This trick works both for personal and Team Drive folders.
Note
It seems that setParent works only in combination with MULTISELECT_ENABLED drive picker feature enabled.
Right now, looks appmaker seems to ALWAYS adds an upload tab itself, so if I add another uploadview, I end up with two upload tabs, the first one uploading to the main folder and selected by default :(
My best guess for a workaround is to not add my own upload view, let the picker upload the file to the main folder, and move the file in the onSelect hook to its final destination. If there's a better way, I'd love the hear.

ImpressPages 4 grid field to upload file to a temp folder instead of repository

I created a plugin for IP 3.9 to upload videos to encoding.com and convert them to mp4 so users would not have to worry about the format of the videos to use in their html5 sites.
In the previous version of ImpressPages I used the element_file of the ItemsArea class to upload the original videos to a temp folder, once the video was encoded I would put it in the Repository so it is available to the users for embedding using a widget.
In the new Impress Pages 4 Grid class the element_file was replaced for the RepostoryFile field and it directly uploads the file to the main Repository (does not let you choose the destination), which makes the non-encoded video to be available to the user.
Is there a way to override this behaviour without modifying the core files?
or is there a way to tell the repository not to show this files until they are encoded (like a visibility flag)?
or can I create a custom field type from a plugin?
You can create custom field type for your plugin. Just use Full class name including namespace in Grid configuration.
File input which save files to tmp folder would be useful for others. So you can contribute it to the core too.

How to upload photos using CakePHP 2.0

I'm developing a simple web app and I just want to allow the user to upload some pictures.
should I just store the picture url on my database table or should I upload the whole picture?
how can I validate the size of the picture being uploaded?
how can I upload the picture from my controller?
thank you all!
I would NOT store the image data in the database. I would create a Behavior that will upload the image to the image directory and store a reference to that image. The behavior can then handle size, mime type, etc. Then add a file upload form to the controller and when the data goes to the model to be saved, it will automatically upload the image and put it where it goes.
If you do not want to build your own, here is a very popular behavior that someone has built.
https://github.com/jrbasso/MeioUpload
Or you could try this simple way of doing it (check the readme.md file) :
https://github.com/malikov/cakephp2.0-image-upload

Upload the customer's image while registering in a zen-cart application

How can we upload an image while registering the customer in zen-cart?
I would like to provide an option to upload the customer's image on registering with a zen-cart application. Is there a plug in for that?
Not that I've heard of. You would need to extend the customer_info table to hold the image file name, add an extra field to the account creation page and then handle the uploaded file in the account creation pages includes/modules/pages's header_php.php file.
However, there is a Zen Cart file upload class that provides an easy to use toolset for the last step. The admin banner page offers a good example to copy from.

How to access Local file system using Silverlight 4 (Webbrowser control)

Our Silverlight application needs to show to the user previews of HTML pages it generates dynamically, so we want to use the WebBrowser to show these pages. The problem is that the HTML contains links to other local files such as images, flash objects, CSS and javascript files. The CSS and javascript could be placed inline in the HTML, but I haven't found a way to embed images. Something simple like this just doesn't work:
Creating the HTML file and the image file in the isolated storage is doable, but I can't get the path to the created HTML file to pass on to WebBrowser.Navigate(uri).
Reading the contents of the HTML file and calling WebBrowser.NavigateToString(string) will show the page, but not any linked images or scripts.
Linking to online sources is not an option as the application needs to work offline (i.e. out of browser) and performance would be much better if the images and flash objects were able to be cached locally.
So, is there any way in Silverlight of showing in the WebBrowser control a local HTML file that contains an image from the local file system, or is it impossible?
Thanks, sandeep agrawal
The only way to make that work is to make the Silverlight an OOB application, and then you can still only access the My* folders.
I heard that someone wrote a browser control that can be used without going OOB but not sure about that. This is a real pain, but a necessary one I guess.