python-2.7


falcon python to resp setup file


class Newuser(object):
def on_get(self,req,resp):
"""
:param req: With request reads Original.exe and append the data with "echo.CUSTDATA:uuid.uuid4()"
:param resp: with response user will be able to download packed Setup.exe
:return: Setup.exe with CUSTDATA:uuid.uuid4() at the end of the file.
"""
print("requests")
import uuid
uui = uuid.uuid4()
self.storage.add_user_uuid(uui,"000")
with open("original.exe",'r') as f:
Original_exe = f.read()
Original_exe+=('echo.CUSTDATA:{}'.format(str(uui)))
with open("Setup.exe",'w') as g:
g.write(Original_exe)
#resp.set_header("Content-Disposition", "attachment; filename=\"%s\"" % Original_exe)
resp.data = "Setup.exe"
now i have this original.exe on the same folder, i just want to update it with uuid which is fine and working , how do i make this available to download when some one does a get request. new to falcon
I got it thanks
with open("original.exe",'r') as f:
Original_exe = f.read()
Original_exe+=('echo.CUSTDATA:{}'.format(str(uui)))
Original = "Setup.exe"
resp.set_header("Content-Disposition", "attachment; filename=\"%s\"" % Original)
resp.data = Original_exe
resp.status = falcon.HTTP_200
if in case anybody needs it

Related Links

app works on local host, raises 500 server error on appengine
comment lines having contain text “test” using Python
Changing unicode encodings in Python 2.7
Python 2.7: Variable defined in previous function, receiving undefined error
get image frames webcam from server with selenium python script
python installation “cc1.exe: error: unrecognized command line option '-mno-cygwin'”
NetworkX - Finding the natural clusters of points on a graph
Installing numpy on Amazon EC2 virtualenv
filter rows based on a True value in a column - python pandas data frame
POST Request to Heroku in Python - 403 Forbidden
Flask: ImportError: No module named flask.ext.login
How to schedule a task using python
Import PyQt in IronPython
Python Read Arduino Serial Only Once
Turn on boundary layer if more than one record in the map extent/ layout view?
Python-magic installation error - ImportError: failed to find libmagic

Categories

HOME
android-espresso
android-fragments
redmine
kivy
plaid
jint
tweepy
responsive-design
mailing-list
graphdb
pywinauto
user-defined-types
gmp
wsf
bsd
conda
uislider
cell
nurbs
web-push
prompt
uri
offline-caching
pyspark-sql
substance
argv
opnet
plantuml
osx-lion
quickcheck
cloveretl
polyml
xerces-c
cordys-opentext
nanogallery
mv
spring-restcontroller
windows-store
icepdf
haar-classifier
google-prediction
httphandler
kitura
libreoffice-writer
cordova-ios
openstack-glance
android-webservice
1010
mpmovieplayercontroller
oracle-fusion-apps
scheduledexecutorservice
researchkit
openquery
visual-studio-monaco
svnserve
tsqlt
adp
distributed-cache
android-expansion-files
ioctl
godeps
asp.net-web-api-helppages
enaml
knife
css-paged-media
domino-designer-eclipse
cache-manifest
ampersand
unidata
debug-symbols
lifetime
encryption-symmetric
jquery-mobile-flipswitch
jchartfx
strdup
infinite
insertion
dynamic-rdlc-generation
html-frames
django-filebrowser
ckeditor.net
smartfox
user-forums
system-requirements
struts2-json-plugin
voice-recording
n-queens
haiku
datacontracts
tablet-pc
grails-validation
bass
ccl
android-2.1-eclair
activestate
android-input-method
asdoc
.net-services
eventaggregator
subtext
levels

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App