Ejemplo n.º 1
0
def download(request):
    scan_uri = request.GET.get("scanURI", "")
    download_file(scan_uri)

    try:
        output = registration.process_file(None, 1, settings.STATIC_DIR, scan_uri, get_reference_form())
    except:
        output = json.dumps({'transformedUrl': None, 'success': False}, separators=(',', ':'))
    return HttpResponse(output)
Ejemplo n.º 2
0
def transform(request):
    if request.method == 'POST':
        filename = request.POST.get("flowFilename", "")
        handle_uploaded_file(request.FILES['file'], filename)

        try:
            config_file = request.POST.get("configFile", "")
            output = registration.process_file(None, 1, settings.STATIC_DIR, filename, get_reference_form(config_file), config_file)
        except:
            output = json.dumps({'transformedUrl': None, 'success': False}, separators=(',', ':'))
        return HttpResponse(output)
    else:
        return HttpResponseNotFound('<h1>Page not found</h1>')