Renders the link to the student upload file.
358509
def file_link(self, instance):
        '''
            
        '''
        sfile = instance.file_upload
        if not sfile:
            return mark_safe('No file submitted by student.')
        else:
            return mark_safe('<a href="%s">%s</a><br/>(<a href="%s" target="_new">Preview</a>)' % (sfile.get_absolute_url(), sfile.basename(), sfile.get_preview_url()))
58530
function (file, responseText) {
        console.log(responseText); // console should show the ID you pointed to
        // read the upload path from the elements data-upload attribute.
        var uploadPath = $(this.dropzone.element).data("upload") + responseText;
        var linkToUploadedFile = "(" + uploadPath + ")";
        if ( file.type.startsWith( "image/" ) ) {
            linkToUploadedFile = "![]" + linkToUploadedFile;
        } else {
            linkToUploadedFile = "[" + responseText + "]" + linkToUploadedFile;
        }
        this.simplemde.value(this.simplemde.value() + "\n" + linkToUploadedFile + "\n");
    }
1294658
def upload(self,
               url,
               method="POST",
               file_path=None):
        
        if not os.path.exists(file_path):
            raise RuntimeError("")

        with open_file(file_path, 'rb') as file:
            size = os.path.getsize(file_path)
            label = "Uploading {filename} ({size:.2f}MB)".format(
                filename=os.path.basename(file_path),
                size=size / float(self.chunk_size) / self.chunk_size
            )

            if method == "PUT":
                resp = put(url, data=file)
            elif method == "POST":
                resp = post(url, data=file)

            content_iter = resp.iter_content(chunk_size=self.chunk_size)

            with progressbar(content_iter,
                             length=size / self.chunk_size,
                             label=label) as bar:
                for _ in bar:
                    pass
527112
public function render()
    {
        $htmlContent = '';
        foreach (self::$linkList->toArray() as $link) {
            $htmlContent .= '<link href="' . $link[0] . '"';
            if (!empty($link[1])) {
                $htmlContent .= ' rel="' . $link[1] . '"';
            }
            if (!empty($link[2])) {
                $htmlContent .= ' type="' . $link[2] . '"';
            }
            if (!empty($link[3])) {
                $htmlContent .= ' media="' . $link[3] . '"';
            }
            $htmlContent .= '>' . PHP_EOL;
        }
        return $htmlContent;
    }
1281866
def _set_upload_url(self):
        """"""
        # pylint: disable=protected-access
        self._upload_url = "/".join(
            [self.jss._url, self._url, self.resource_type, self.id_type,
             str(self._id)])
379512
public function fileExistFormatLink( $path , $user , $event , $view , $name , $class = NULL){
		
		$link = $path.$user.'/'.$view.'_'.$event.'-'.$user.'.pdf';
		$url  = getcwd().'/'.$link;

		$add  = '';
		
		if ( \File::exists($url) )
		{
			$asset = asset($link);

			if($class){
				$add = ' class="'.$class.'" ';
			}
			
			return '<a target="_blank" href="'.$asset.'"'.$add.'>'.$name.'</a>';	
		}
		
		return '';
	}
655286
function (req, res) {
                var s3 = new AWS.S3(),
                    bucket = req.params.name,
                    key = getFullKeyParam(req.params, req.route),
                    contentType = mime.lookup(key),
                    params = {
                        Bucket: bucket,
                        Key: key,
                        // Pipe the file through the request body
                        Body: req
                    },
                    trackUploadProgress = function (evt) {
                        // This function is called each time a chunk of the file is uploaded
                        //console.log(evt);
                    },
                    handleUploadComplete = function (err, data) {
                        if (err) {
                            res.status(500).send(err);
                        } else {
                            // Add s3g link to reference the resource                            
                            data.links = [{
                                rel: 'self',
                                href: getOriginalink(req)
                            }];
                            
                            res.json(data);
                        }
                    };

				// Set content type for object if we have one
                if (contentType) {
                    params.ContentType = contentType;
                }

                s3.upload(params).on('httpUploadProgress', trackUploadProgress).send(handleUploadComplete);
            }
790406
protected function renderResource(): void
    {
        $processedImageInfo = $this->imageService->processImage($this->originalAsset->getResource(), $this->adjustments->toArray());
        $this->resource = $processedImageInfo['resource'];
        $this->width = $processedImageInfo['width'];
        $this->height = $processedImageInfo['height'];
        $this->persistenceManager->whitelistObject($this->resource);
    }
210955
public function run()
	{

		list($name) = $this->resolveNameID();

		$this->htmlOptions['id'] = $this->id.'-'.($this->hasModel() ? get_class($this->model) : 'fileupload') . '-form';

		$this->options['url'] = $this->url;

		// if acceptFileTypes is not set as option, try getting it from models rules
		if (!isset($this->options['acceptFileTypes'])) {
			$fileTypes = $this->getFileValidatorProperty($this->model, $this->attribute, 'types');
			if (isset($fileTypes)) {
				$fileTypes = (preg_match(':jpg:', $fileTypes) && !preg_match(':jpe:', $fileTypes) ? preg_replace(
					':jpg:',
					'jpe?g',
					$fileTypes
				) : $fileTypes);
				$this->options['acceptFileTypes'] = 'js:/(\.)(' . preg_replace(':,:', '|', $fileTypes) . ')$/i';
			}
		}

		// if maxFileSize is not set as option, try getting it from models rules
		if (!isset($this->options['maxFileSize'])) {
			$fileSize = $this->getFileValidatorProperty($this->model, $this->attribute, 'maxSize');
			if (isset($fileSize)) {
				$this->options['maxFileSize'] = $fileSize;
			}
		}

		if ($this->multiple) {
			$this->htmlOptions["multiple"] = true;
		}

		$this->render($this->uploadView);
		$this->render($this->downloadView);
		$this->render($this->formView, array('name' => $name, 'htmlOptions' => $this->htmlOptions));

		if ($this->previewImages || $this->imageProcessing) {
			$this->render($this->previewImagesView);
		}

		$this->registerClientScript($this->htmlOptions['id']);
	}
76284
def build_upload_params(file_path, outputformat, callback_url = nil, options = {})
      upload_params = { :format => outputformat}
      upload_params.merge!(:callback => callback(callback_url)) if callback(callback_url).present?
      upload_params.merge!(:input => "download",:link => file_path )
      upload_params.merge!(options)
    end
473867
public function render()
    {
        if (!$this->visible) {
            return;
        }

        if ($this->sensitive) {
            $anchor = new SwatHtmlTag('a');

            if ($this->link_value === null) {
                $anchor->href = $this->link;
            } elseif (is_array($this->link_value)) {
                $anchor->href = vsprintf($this->link, $this->link_value);
            } else {
                $anchor->href = sprintf($this->link, $this->link_value);
            }

            $anchor->open();
        }

        parent::render();

        if ($this->sensitive) {
            $anchor->close();
        }
    }
1082191
protected function RenderImpl()
    {

        $url = $this->owner->getURLNode() . "::" . $this->id . "&ajax=true";
        if ($this->refresh) {
            $this->setAttribute("onclick", "getUpdate('{$url}');event.returnValue=false; return false;");
        }
        $this->setAttribute('src', $this->owner->getURLNode() . "::" . $this->id . ':' . time() . '&binary=true');
    }
434554
public function render()
    {
        $widgetContainerId = $this->buildWidgetContainerId();
        
        $returnValue = $this->renderLabel();
        $returnValue .= "<div id='${widgetContainerId}' class='form-elt-container file-uploader'>";
        
        if ($this->value instanceof tao_helpers_form_data_UploadFileDescription && $this->value->getAction() == tao_helpers_form_data_UploadFileDescription::FORM_ACTION_DELETE) {
            // File deleted, nothing to render
        } elseif ($this->value instanceof tao_helpers_form_data_FileDescription && ($file = $this->value->getFile()) != null) {
            
            // A file is stored or has just been uploaded.
            $shownFileName = $this->value->getName();
            $shownFileSize = $this->value->getSize();
            $shownFileSize = number_format($shownFileSize / 1000, 2); // to kb.
            $shownFileTxt = sprintf(__('%s (%s kb)'), $shownFileName, $shownFileSize);
            $deleteButtonTitle = __("Delete");
            $deleteButtonId = $this->buildDeleteButtonId();
            $downloadButtonTitle = __("Download");
            $downloadButtonId = $this->buildDownloadButtonId();
            $iFrameId = $this->buildIframeId();
            $returnValue .= "<span class=\"widget_AsyncFile_fileinfo\">${shownFileTxt}</span>";
            $returnValue .= "<button id=\"${downloadButtonId}\" type=\"button\" class=\"download btn-neutral small icon-download\" title=\"${downloadButtonTitle}\">";
            $returnValue .= "<button id=\"${deleteButtonId}\" type=\"button\" class=\"delete btn-error small icon-bin\" title=\"${deleteButtonTitle}\"/>";
            $returnValue .= "<iframe style=\"display:none\" id=\"${iFrameId}\" frameborder=\"0\"/>";
            
            // Inject behaviour of the Delete/Download buttons component in response.
            $returnValue .= self::embedBehaviour($this->buildDeleterBehaviour() . $this->buildDownloaderBehaviour());
        } else {
            
            // No file stored yet.
            // Inject behaviour of the AsyncFileUpload component in response.
            $returnValue .= self::embedBehaviour($this->buildUploaderBehaviour());
        }
        
        $returnValue .= "</div>";
        
        return (string) $returnValue;
    }
697782
function () {
                        //Render the full file
                        return ejs.renderFile(file, data, options, function (error, content) {
                            if (error) {
                                self.emit("error", error);
                                return callback(-2);
                            }
                            //Call the provided callback with the file content
                            return callback({
                                "data": new Buffer(content), 
                                "mimeType": "text/html"
                            });
                        });
                    }
1318558
function render() {
		$args=func_get_args();
		$format=$args?array_shift($args):'png';
		if (PHP_SAPI!='cli') {
			header('Content-Type: image/'.$format);
			header('X-Powered-By: '.Base::instance()->PACKAGE);
		}
		call_user_func_array(
			'image'.$format,
			array_merge([$this->data,NULL],$args)
		);
	}
899606
def render_link(self, template_pack=TEMPLATE_PACK, **kwargs):
        
        link_template = self.link_template % template_pack
        return render_to_string(link_template, {'link': self})
815255
def render(filename, context=binding)
      contents=File.read(expand_filename(filename))
      template(contents, context)
    end