public AjaxFineUpLoaderUI(
            String Dialog_divId, String FineUploader_divId,
            String OpenDilaogElementId,
            String ajax_url_UpLoadFiles,
            String ajax_url_ListFiles,
            String ajax_url_DeleteFiles)
        {
            this.ajax_url_UpLoadFiles = ajax_url_UpLoadFiles;
            this.ajax_url_ListFiles = ajax_url_ListFiles;
            this.ajax_url_DeleteFiles = ajax_url_DeleteFiles;

            _dialog = new DialogButton(Dialog_divId, OpenDilaogElementId);
            _dialog.options.autoOpen = false;
            _dialog.options.width = 520;
            _dialog.options.height = 480;

            _options = new FineUploader(new jqSelector() { IdName = FineUploader_divId });
            _options.request = new requestOptions() { endpoint = ajax_url_UpLoadFiles };
        }
Ejemplo n.º 2
0
        //public JsonRequestBehavior GetStateByStateID(short stateId)
        //{
        //    var states = _stateRepository.Get(w => w.cod_estado == stateId).cod_estado;
        //    return Json(new { Result = true, states = states }, JsonRequestBehavior.AllowGet);
        //}
        //
        // GET: /FileUpload/
        public FineUploader.FineUploaderResult UploadFile(FineUploader.FineUpload upload)
        {
            // asp.net mvc will set extraParam1 and extraParam2 from the params object passed by Fine-Uploader
            var dir = ConfigurationManager.AppSettings.Get("ImageUpload");

            var filePath = Path.Combine(dir, upload.Filename);
            try
            {
                upload.SaveAs(filePath);
            }
            catch (Exception ex)
            {
                return new FineUploaderResult(false, error: ex.Message);
            }

            // the anonymous object in the result below will be convert to json and set back to the browser
            return new FineUploaderResult(true, new { fileName = upload.Filename });
        }