Having a connection issue with cx_oracle on a Flask app - python

Im trying to develop an app that gets a user input (an excel spreadsheet) and then upload that information to a database depending if the user pressed option A or option B.
The issue I´m having is that when I submit and upload something and try to then click the "go back" botton and try to upload someting else, the script gives me an error.
The backend is:
#app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
#Read the excel that was dragged
file = request.files['file']
#Identify the survey and project switchs
survey_switch = request.form.get("switch-1")
project_switch = request.form.get("switch-2")
#Convert the file dragged into a dataframe
df = pd.read_excel(file, skiprows=3, engine='openpyxl')
if survey_switch == 'Survey' and project_switch != 'Project':
session["survey_switch"] = survey_switch
session["project_switch"] = None
connection = utils.CreateConnection(file, df)
#Insert the Survey on the file dragged
utils.CreateSurvey(file, connection, df)
return redirect(url_for('messages'))
if project_switch == 'Project' and survey_switch != 'Survey':
session["survey_switch"] = None
session["project_switch"] = project_switch
connection = utils.CreateConnection(file, df)
#Insert the Project on the file dragged
utils.CreateProject(file, connection, df)
return redirect(url_for('messages'))
if survey_switch == 'Survey' and project_switch == 'Project':
session["survey_switch"] = survey_switch
session["project_switch"] = project_switch
connection = utils.CreateConnection(file, df)
#Insert the Survey and Project on the file dragged
utils.CreateSurvey(file, connection, df)
utils.CreateProject(file, connection, df)
return redirect(url_for('messages'))
return render_template('SIMMetadata_index.html')
#Make the messages template
#app.route('/UserInterface', methods=['GET', 'POST'])
def messages():
#Make the go back
if request.method == 'POST':
session["survey_switch"] = None
session["project_switch"] = None
return redirect(url_for('index'))
return render_template('UserInterfaceMessages.html')
The frontend are:
Index page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11">
<title>SIM Metadata</title>
<link href="../static/css/em-unity-1.6.0.min.css" media="all" rel="stylesheet" />
<script type="text/javascript" src="../static/js/vendor/svg4everybody.min.js"></script><!-
- polyfill for SVG icons -->
</head>
<body>
<!-- Banner azul del head-->
<header class="em-c-header em-c-header--blue" role="banner">
<div class="em-l-container em-c-header__inner">
<div class="em-c-header__body">
<div class="em-c-header__title-container">
<h2 class="em-c-header__title"><a href="#" rel="home" class="em-c-header__title-
link">SIM Metadata</a></h2>
</div>
</div>
</header>
<!-- la caja de drag files con el padding respectivo-->
<div class="em-u-padding">
<!-- asignar distinta clase em-is-valid si el documento insertado es valido o em-has-error
si no es valido--->
<form action="/" method="POST" enctype="multipart/form-data" autocomplete="off">
<div class="em-c-field em-c-field--file-upload ">
<label for="file" class="em-c-field__label">KDM Spreadsheet</label>
<div class="em-c-field__body">
<svg class="em-c-icon em-c-icon--large em-c-field__block-icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../static/images/48/em-<body>
<!-- Banner azul del head-->
<header class="em-c-header em-c-header--blue" role="banner">
<div class="em-l-container em-c-header__inner">
<div class="em-c-header__body">
<div class="em-c-header__title-container">
<h2 class="em-c-header__title"><a href="#" rel="home" class="em-c-header__title-
link">SIM Metadata</a></h2>
</div>
</div>
</header>
<!-- la caja de drag files con el padding respectivo-->
<div class="em-u-padding">
<!-- asignar distinta clase em-is-valid si el documento insertado es valido o em-has-error
si no es valido--->
<form action="/" method="POST" enctype="multipart/form-data" autocomplete="off">
<div class="em-c-field em-c-field--file-upload ">
<label for="file" class="em-c-field__label">KDM Spreadsheet</label>
<div class="em-c-field__body">
<svg class="em-c-icon em-c-icon--large em-c-field__block-icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../static/images/48/em-
icons.svg#upload"></use>
</svg>
<input type="file" name="file" id="file" class="em-c-file-upload"
placeholder="Placeholder" enctype="multipart/form-data" />
<ul class="em-c-field__list em-js-field-list">
<li class="em-c-field__item">Drag file here</li>
<li class="em-c-field__item em-c-field__item--small">Or click to choose file</li>
</ul>
</div>
<div class="em-c-field__note">The extension of the spreadsheet must be .xls or .xslx</div>
</div>
<ul class="em-c-switch-list">
<li class="em-c-switch-list__item">
<div class="em-c-field">
<div class="em-c-field__body">
<div class="em-c-switch">
<label class="em-c-switch__label" for="switch-1">
<span class="em-c-switch__toggle"></span>
<span class="em-c-switch__label-name">Upload Survey</span>
</label>
<input id="switch-1" type="checkbox" name="switch-1" value="Survey" class="em-c-
switch__input em-js-switch-trigger" >
</div>
</div>
</div>
</li>
<li class="em-c-switch-list__item">
<div class="em-c-field">
<div class="em-c-field__body">
<div class="em-c-switch">
<label class="em-c-switch__label" for="switch-2">
<span class="em-c-switch__toggle"></span>
<span class="em-c-switch__label-name">Upload Project</span>
</label>
<input id="switch-2" type="checkbox" name="switch-2" value="Project" class="em-c-
switch__input em-js-switch-trigger">
</div>
</div>
</div>
</li>
</ul>
<!-- agregar las botones de survey y project-->
<!--agregar el boton de submit -->
<div class="em-u-text-align-center">
<div class="em-c-btn-group "></div>
<button type="submit" value="submit" class="em-c-btn em-c-btn--primary">
<span class="em-c-btn__text">Submit</span>
</button>
</div>
</form>
<script type="text/javascript" src="../static/js/em-unity-1.6.0.min.js"></script>
</body>
Error I get
"Oracle client has already been initialized"
"'None Type' object has no attribute 'cursor'"

The first error suggests that you are calling cx_Oracle.init_oracle_client() more than one time. You aren't supposed to do that! See the documentation for details. You can perform the initialization directly in your module code, or you can use a global variable to ensure that it is only called once.
The second error suggests that you are trying to create a cursor on a None connection object -- which in turn suggests that your utils.CreateConnection() function is catching exceptions and returning None instead of a valid connection. Avoid catching exceptions unless you have to, and then ensure that you're not just swallowing the exception and causing exceptions elsewhere!

Related

How get bootstrap in my html read through python socket

I have been try simple python socket, I have bootstrap.min.css in the same directory of registro.html, but it's not charge style from bootstrap, registro.html, bootstrap.min.css and soket_test.py are in same directory.
I have been do request from any browser.
socket_test.py
#!/usr/bin/env python
import socket
import json
import re
def getValorArreglo(parametros, clave):
for indice in parametros:
if indice.split('=')[0] == clave:
return indice.split('=')[1]
return None
'''def setSiguienteVista(action,parametros):
if action != None and action == '/formulario':'''
host = '127.0.0.1'
port = 8791
server_sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) # Create a socket object
server_sock.bind((host , port)) # Bind to the port
server_sock.listen(5) # Now wait for client connection.
print ('Entering infinite loop; hit CTRL-C to exit')
while True:
# Establish connection with client.
client_sock, (client_host, client_port) = server_sock.accept()
print ('Got connection from', client_host, client_port)
request = b""
contador = 0
while not b"\r\n\r\n" in request:
request += client_sock.recv(1000) # should receive request from client. (GET ....)
client_sock.send(b'HTTP/1.0 200 OK\n')
client_sock.send(b'Content-Type: text /html\n')
client_sock.send(b'\n') # header and body should be separated by additional newline
# you can paste your 2 text field html here in the <body>
HtmlFile = open('registro.html','r')
registro = HtmlFile.read()
client_sock.send(registro)
client_sock.close()
registro.html
<!DOCTYPE html>
<html>
<head>
<title>Proyecto Sistemas Distribuidos</title>
<link rel="stylesheet" href="bootstrap.min.css">
</head>
<body>
<form method="post" action="formulario"class="form-group" >
<div class="form-row etiqueta_principal">
<label class="text-label-principal">REGISTRO DE BACHILLER ASPIRANTE</label>
</div>
<div class="form-row">
<div class="form-group col-md-3 item-div">
<label class="col-md-12 item-label" for="nombre1">Primer Nombre</label>
<input type="text" class="form-control" id="nombre1" name="nombre1" placeholder="Ingrese primer nombre"
required>
</div>
<div class="form-group col-md-3 item-div">
<label class="col-md-12 item-label" for="nombre2">Segundo Nombre</label>
<input type="text" class="form-control" id="nombre2" name="nombre2"
placeholder="Ingrese segundo nombre">
</div>
<div class="form-group col-md-3 item-div">
<div class="item-div button-div">
<button type="submit" class="btn btn-secondary">Enviar Solicitud</button>
</div>
</div>
</form>
</body>
</html>

Jupyter notebook API to get notebooks

I have my jupyter hub and single-user server running. I am using Jupyter notebook REST APIs to get all available notebooks. I am using http://127.0.0.1:8000/user/username/api/contents . With this I am able to see all available notebooks on mu UI.
However when I try to do the same from my python script I am getting 200 response code but unable to extract any content as its redirecting to login page where I need to enter username and password for my user. I also tried to pass these credentials through requests package. Something like this
import requests
api_url = 'http://127.0.0.1:8000/user/username/api/contents'
result = requests.get(api_url, auth=('username', 'password'))
print result
print result.json()
The outpus is:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Jupyter Hub</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/hub/static/css/style.min.css?v=d96e0760e0c2b7356ce89635b646c350" type="text/css"/>
<script src="/hub/static/components/requirejs/require.js?v=6da8be361b9ee26c5e721e76c6d4afce" type="text/javascript" charset="utf-8"></script>
<script>
require.config({
urlArgs: "v=('20170907062813',)",
baseUrl: '/hub/static/js',
paths: {
components: '../components',
jquery: '../components/jquery/jquery.min',
bootstrap: '../components/bootstrap/js/bootstrap.min',
moment: "../components/moment/moment",
},
shim: {
bootstrap: {
deps: ["jquery"],
exports: "bootstrap"
},
}
});
</script>
<script type="text/javascript">
window.jhdata = {
base_url: "/hub/",
prefix: "/",
}
</script>
</head>
<body>
<noscript>
<div id='noscript'>
Jupyter Hub requires JavaScript.<br>
Please enable it to proceed.
</div>
</noscript>
<div id="header" class="navbar navbar-static-top">
<div class="container">
<span id="jupyterhub-logo" class="pull-left"><img src='/hub/logo' alt='JupyterHub' class='jpy-logo' title='Home'/></span>
</div>
</div>
<div id="login-main" class="container">
<form action="/hub/login?next=%2Fhub%2Fuser%2Fpnda%2Fapi%2Fcontents" method="post" role="form">
<div class="auth-form-header">
Sign in
</div>
<div class='auth-form-body'>
<p id='insecure-login-warning' class='hidden'>
Warning: JupyterHub seems to be served over an unsecured HTTP connection.
We strongly recommend enabling HTTPS for JupyterHub.
</p>
<label for="username_input">Username:</label>
<input
id="username_input"
type="username"
autocapitalize="off"
autocorrect="off"
class="form-control"
name="username"
val=""
tabindex="1"
autofocus="autofocus"
/>
<label for='password_input'>Password:</label>
<input
type="password"
class="form-control"
name="password"
id="password_input"
tabindex="2"
/>
<input
type="submit"
id="login_submit"
class='btn btn-jupyter'
value='Sign In'
tabindex="3"
/>
</div>
</form>
</div>
<div class="modal fade" id="error-dialog" tabindex="-1" role="dialog" aria-labelledby="error-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="error-label">Error</h4>
</div>
<div class="modal-body">
<div class="ajax-error">
The error
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" data-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
<script>
if (window.location.protocol === "http:") {
// unhide http warning
var warning = document.getElementById('insecure-login-warning');
warning.className = warning.className.replace(/\bhidden\b/, '');
}
</script>
</body>
</html>
Traceback (most recent call last):
File "test.py", line 31, in <module>
check_running()
File "test.py", line 28, in check_running
contents = r.json()
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 740, in json
return json.loads(self.content.decode(encoding), **kwargs)
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
I am fairly new to Jupyter. My I missing out on something. How else can I authenticate my user prior calling any API.
Saw this in jupyerhub documentation - Note that the API token authorizes JupyterHub REST API requests. The same token does not authorize access to the Jupyter Notebook REST API provided by notebook servers managed by JupyterHub. A different token is used to access the Jupyter Notebook API.
So this is the exactly what I am looking for. How can I create this different token so as to access jupyter notebook APIs thorugh hub.
Jupyter Notebooks require an access token (this should show when you start up jupyter notebook). In my case, something like this, then worked:
import requests
#Note that the url doesn't have a user or username attribute
api_url = 'http://127.0.0.1:8888/api/contents'
payload = {'token': 'xxxxxx'}
result = requests.get(api_url
#, auth=('username', 'password')
,params = payload)

How to get contents from a local text file to print on individual lines in a html template (Python/Flask)

screenshot of the outputI'm looking to get posts from a user to post on individual lines. At the moment I take in a name, email and comment, pass it to the app.py file and store it to a text file. I return a name, email, comment and the time of the comment. When I read the file and pass in back to the html template the posts display one after the other (see the screenshot included), and im trying to have them display one below each other. f.write("\n") results in the actual text file skipping a line however this does not occur in the template.
form_action.html
<html>
<div align = "center">
<body style="background-color: #3DC247;">
<head>
<title>Conor McGregor</title>
</head>
<body>
<div align = "center">
<h1 style="font-family:verdana;">I AM EL CHAPO</h1>
<div align = "center">
<h2 style="font-family:verdana;">YOU'LL DO NUTIN.</h2>
<div align = "center">
<h2 style="font-family:verdana;">Disscusion Page</h2>
<body>
<div id="container">
<div class="title">
<h3 style="font-family:verdana;">Please fill in your details
below and your comment to join the discussion</h3>
</div>
<div id="content">
<form method="post" action="{{ url_for('hello') }}">
<label for="yourname" style="font-family:verdana;">Please
enter your name:</label>
<input type="text" name="yourname" /><br /><br>
<label for="youremail" style="font-family:verdana;">Please
enter your email:</label>
<input type="text" name="youremail" /><br /><br>
<label for="yourcomment"style="font-family:verdana;">Please
enter your comment:</label>
<input type="textarea" name="yourcomment" rows="4" cols="50">
<input type="submit" /><br>
</form>
</div>
</div>
</div>
</div>
<div id="container">
<div class="title">
<h1 style="font-family:verdana;"><p>Comments</p></h1>
</div>
<div id="content">
{{details}}
</div>
</div>
</body>
</html>
app.py
from flask import Flask, render_template, request, url_for
import time
import datetime
# Initialize the Flask application
app = Flask(__name__)
# Define a route for the default URL, which loads the form
#app.route('/')
def form():
return render_template('form_submit.html')
#app.route('/hello/', methods=['POST','GET'])
def hello():
global time
name=request.form['yourname']
email=request.form['youremail']
comment=request.form['yourcomment']
comment_time=time.strftime("%a-%d-%m-%Y %H:%M:%S")
f = open ("user+comments.txt","a")
f.write(name + ' ' + email + ' ' + comment + " " + comment_time)
f.write('\n')
f.close()
with open("user+comments.txt", "r") as f:
details = f.read()
f.close()
return render_template('form_action.html', details = details, name=name,
email=email, comment=comment, comment_time=comment_time)
if __name__ == '__main__':
app.run(debug=True)
HTML does not know what \n is. You can fix this in two ways.
Convert str details to list details
details = f.read().split('\n')
This converts the str object to list object. You could print it in your template using
{% for detail in details %}
{{detail}}
{% endfor %}
Replace \n with <br>
details = f.read().replace('\n','<br>')
and then print it as {{ details|safe }} in form_action.html.
It is important that you use the safe filter. The <br> would be escaped without it and rendered as simple text.

Retrieving value from Python SimpleCookie and using it in SELECT query

I posted a question yesterday :
Redirect python script to another python script for validation of login credentials
after i was done with that bit, i had another problem related to cookies. I sent the cookies in the header from the python script code:
#Create Cookie
C= Cookie.SimpleCookie()
#take the value of usernameLogin into the variable username
username= form.getvalue('usernameLogin')
#Set-Cookie header with the usernameLogin key
C['usernameLogin'] = username
this code is in the previous python script validate.py
i want to send the cookies to the next script page1.py
this is my code for page1.py :
import cgi
import cgitb
import sqlite3
import Cookie
import os
user_name=""
user_id=""
useridDb=""
resultid=""
resultname=""
idUser=""
if os.environ.has_key("HTTP_COOKIE"):
C= Cookie.SimpleCookie(os.environ.get("HTTP_COOKIE",""))
if C.has_key("usernameLogin"):
user_name= C['usernameLogin'].value
print user_name
form= cgi.FieldStorage()
cgitb.enable()
#Open connection
conn= sqlite3.connect("manager.db")
page1head= """
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Excursions</title>
<link rel='stylesheet' type='text/css' href='/page1.css/' />
<script lang="javascript" type="text/javascript" src="/suggestions.js/"> </script>
</head><body>
<div id="container">
<div id="header">
<h1>Field Note Manager</h1>
<p class="description">Observe...Record...Save!</p>
</div>
<!-- Content Section -->
<div id="wrapper">
<!-- Main Content Section -->
<div id="content">
<h2>Excursions</h2>
<table CELLPADDING="10" ><tr><th> <strong> Location </strong> </th><th> <strong> Date </strong> </th> <th> Time </th></tr>"""
page2head="""</table>
</div>
</div>
<!-- Logout Section -->
<div id="navigation">
<input type="hidden" name="greeting"/>
<form action="http://localhost:8000/cgi-bin/logout.py">
<p><input type="submit" name="logoutBtn" value="Logout" /> </p>
</form>
</div>
<!-- Extra Section for Queries -->
<div id="extra">
<h2>Quick Links</h2>
<dl> <dd><a href="http://localhost:8000/cgi-bin/query.py"/>Query the Database</a> </dd></dl>
<dl> <dd><a href="http://localhost:8000/cgi-bin/addFieldNote.py"/>Add Field Note</a> </dd></dl>
</div>
<!-- Footer -->
<div id="footer">
<p>Copyright 42578647, 2012</p>
</div>
</div>
"""
page1foot= """
</body>
</html>
"""
print "Content_type: text/html\n\n"
print page1head
#print excursion details
cur=conn.cursor()
resultid= cur.execute("SELECT userid FROM login WHERE username=?",[user_name])
cur.fetchone()
for data in resultid:
idUser= int(data)
resultname= cur.execute("""SELECT location,excurDate,excurTime FROM excursion WHERE user=?""",[idUser])
cur.fetchall()
for record in resultname:
print"<tr><td>",record[0],"</td><td>",record[1],"</td><td>",record[2],"</td></tr>"
print page2head
print page1foot
It prints the page, but no queries are generated. Is it because the cookie has not been retrieved and parsed or is there some problem with the SELECT statement?
I found out the answer. The cookies had not been set before the header in the previous validate.py

How to bypass Mechanize "AmbiguityError" in Python

I am trying to upload images to ImageBam by filling its web-forms and requesting POST.
I don't know too much about urllib2, httplib, multipart stuff. I am trying to use MECHANIZE module
But I think it shouldn't be too complex because it is just a web form, I will fill it and post it.
The page, where upload forms are:
http://www.imagebam.com/basic-upload
The form I am trying to fill:
<form name='form' id='form' enctype="multipart/form-data" method="post" action="/sys/upload/save">
<table align="center">
<tr>
<td>
01: <input type="file" name="file[]" size="30"><br>
02: <input type="file" name="file[]" size="30"><br>
03: <input type="file" name="file[]" size="30"><br>
04: <input type="file" name="file[]" size="30"><br>
05: <input type="file" name="file[]" size="30"><br>
also I saw a guy created an app using python;
http://sourceforge.net/projects/pymguploader/files/pymguploader/2011-12-24/
I want to write something like that, but much more basic of course.
anyway, here is my problem;
when I execute these;
import mechanize
a=mechanize.Browser()
a.open("http://www.imagebam.com/basic-upload")
forms=mechanize.ParseResponse(response)
a.select_form(nr=0)
dosya=open("file path...","r")
everything works fine I think.
also
print a
gives this output:
<Browser visiting http://www.imagebam.com/basic-upload
selected form:
<form POST http://www.imagebam.com/sys/upload/save multipart/form-data
<FileControl(file[]=<No files added>)>
<FileControl(file[]=<No files added>)>
<FileControl(file[]=<No files added>)>
<FileControl(file[]=<No files added>)>
<SelectControl(content_type=[*x, 1, 0])>
<SelectControl(thumb_size=[*100, 150, 180, 250, 300, 350])>
<SelectControl(thumb_aspect_ratio=[crop, *resize])>
<SelectControl(thumb_file_type=[gif, *jpg])>
<CheckboxControl(thumb_info=[1])>
<CheckboxControl(gallery_options=[*1])>>
>
but when I
a["file[]"]=dosya
the error is;
Traceback (most recent call last):
File "<pyshell#46>", line 1, in <module>
a["file[]"]=dosya
File "build\bdist.win32\egg\mechanize\_form.py", line 2780, in __setitem__
control = self.find_control(name)
File "build\bdist.win32\egg\mechanize\_form.py", line 3101, in find_control
return self._find_control(name, type, kind, id, label, predicate, nr)
File "build\bdist.win32\egg\mechanize\_form.py", line 3183, in _find_control
raise AmbiguityError("more than one control matching "+description)
AmbiguityError: more than one control matching name 'file[]'
How can I solve this problem?
SOLVED
Solution:
a.add_file(dosya,"filename",nr=0)
that automatically searches type=file inputs and adds my file to first one(nr=0 provides it)
New Problem
After I sending POST data (or I think it sends)
This page comes as a response;
<?xml version='1.0' encoding='utf-8'?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://developers.facebook.com/schema/" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="ImageBam.com" />
<meta name="description" content="Free Image Hosting and photo sharing. Create an online album with bulk upload tools and share with family and friends." />
<meta name="keywords" content="image hosting, free image hosting, photo sharing, upload photo, free photo gallery, photo host, image gallery" />
<meta name="robots" content="follow" />
<meta name="revisit-after" content="1 days" />
<meta property="fb:admins" content="3433880" />
<link rel="stylesheet" href="http://www.imagebam.com/style.css" type="text/css" />
<link rel="shortcut icon" href="http://www.imagebam.com/favicon.ico" />
<title>Fast, Free Image Hosting - ImageBam</title>
<script type="text/javascript" src="http://www.imagebam.com/JS/imagebam.js"></script>
<script type="text/javascript" src="http://www.imagebam.com/JS/pt.js"></script>
</head>
<body>
<!-- IMAGEBAM HEADER -->
<div class="scrollme">
<div class="abody">
<!-- everything -->
<div class="banner cursor" style="float:left;" onclick='top.location="http://www.imagebam.com"'></div>
<div style="float:right; text-align:right; border:0px solid #f2f2f2; border-top:none; padding-top: 5px; padding-left:3px; padding-right:10px;">
</div>
<div style="clear:left;"></div>
<div class="dtab">
<ul>
<li class="inactive">Multi-Upload</li>
<li class="inactive">Zip-Upload</li>
<li class="inactive">Basic Upload</li>
<li class="inactive">Learn More</li>
<li class="inactive">FAQ</li>
<li class="inactive">Register</li>
<li class="inactive">Login</li>
<li class="inactive">Premium</li>
</ul>
</div><br />
<!-- Google Code for Imagebam Uploaded Image Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
function img404(ID,fsrc){
document.getElementById('thumb_404_info').style.display="block";
document.getElementById("img_"+ID).style.display = "none";
document.getElementById("alt_"+ID).style.display = "inline";
setTimeout("reloadImg("+ID+",'"+fsrc+"')", 500);
}
function reloadImg(ID,fsrc){
mrand = Math.random();
document.getElementById("img_"+ID).style.display = "inline";
document.getElementById("alt_"+ID).style.display = "none";
document.getElementById("img_"+ID).src = fsrc+"?"+mrand;
}
/* ]]> */
</script>
<div class="box_wait" style="text-align:center; display:none;" id="thumb_404_info">Thumbnails that are being processed in the background might not load right away.<br /></div>
<div style="text-align:center; margin-bottom:5px;">
<b>NEW!</b> VideoBam.com (HD Video Hosting)
</div>
<fieldset><legend><img src="/img/icons/photos.png" alt="" style="vertical-align:middle; line-height:16px; height:16px; padding-right:5px;" /> All at Once</legend>
<table style="width:100%;"><tr>
<td>
<b>BB-Code</b><br />
<textarea onclick="this.select();" style="width:300px; height:200px;"></textarea>
</td>
<td>
<b>HTML-Code</b><br />
<textarea onclick="this.select();" style="width:300px; height:200px;"></textarea>
</td>
</tr>
</table>
</fieldset>
<!--
<fieldset><legend style='color:green;'><img src='/img/icons/new.png' alt='' style='vertical-align:middle; line-height:16px; height:16px; padding-right:5px;'> NEW! ImageBam Remote Upload Widget</legend>
<b>Webmasters / Mods!</b><br> Allow your users to upload images to ImageBam <b>without leaving your website or forum!</b><br> Add our new ImageBam Remote Upload Widget to you website!<br>
Please spread the word! Thank you!
</fieldset>
-->
<div style="text-align:center; margin-bottom:5px;">
<b>NEW!</b> VideoBam.com (HD Video Hosting)
</div>
<fieldset><legend><img src="/img/icons/delete.png" alt="" style="vertical-align:middle; line-height:16px; height:16px; padding-right:5px;" /> All Removal Links</legend>
Do not share the links below. You can use them to delete the photos you have uploaded.<br />
<textarea onclick="this.select()" style="width:600px; height:200px;"></textarea>
</fieldset>
<!-- Google Code for Imagebam Uploaded Image Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1068053810;
var google_conversion_language = "en_US";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "6tqpCPa-chCy6qT9Aw";
var google_conversion_value = 0;
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1068053810/?label=6tqpCPa-chCy6qT9Aw&guid=ON&script=0" />
</div>
</noscript>
</div>
<div class="footer">
<a class="footera" href="http://www.imagebam.com/">ImageBam</a> | <a class="footera" href="/remote-upload-widget">Remote Upload Widget</a> | <a class="footera" href="http://www.imagebam.com/screengrab_upload_firefox_extension">screengrab tool</a> | <a class="footera" href="http://www.imagebam.com/terms-of-service">terms of service</a> | <a class="footera" href="http://www.imagebam.com/frequently-asked-questions">help</a> | <a class="footera" href="http://support.imagebam.com" target="_blank">support forums</a> | <a class="footera" href="http://code.google.com/p/imagebam-api/">API for developers</a> | <a class="footera" href="http://www.imagebam.com/report-abuse">report abuse</a>
<div style="height:35px; overflow:hidden;">
<div id="google_translate_element" style="margin-top:9px;"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit" type="text/javascript"></script>
</div>
<div style="text-align:center; color:#999; margin-top:10px;">
<table style="margin:auto;"><tr><td><img src="http://1.imagebam.com/static/img/tux.png" alt="tux" /></td><td>Powered by dedicated Linux servers. Flixya Entertainment, LLC © 2010</td></tr></table>
</div>
</div>
</div>
<div id="updater_index"></div>
<script type="text/javascript">
</script>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2424497-2";
urchinTracker();
</script>
</body>
</html>
Normally, it is the after-uploading page that comes out with image's links etc.
But I think there is a dynamic process, because the links were not prepared when I got the page.
Am I missing something? because even if you dont fill the inputs on form, if you submit() it, it redirects you to that after-uploading page..
Use select_control() also with nr=0 to select the first file.

Categories

Resources