Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Faked path - Smartphone.

Reply
Thread Tools

Faked path - Smartphone.

 
 
Mr. X.
Guest
Posts: n/a
 
      01-22-2013
Hello.
When I do something like this:
<input type="file" accept="image/*" capture ></input>

I can attach a picture or camera on smartphones.

This all fine,
but what if I want to show the picture to the user who choose it.
I created for that a <div> element and try to set the background-image to
the file (which is on local computer or on local smarphone) -

Then I got the path of :
c:/fakepath/myfile.jpg.

How can I solve the problem?
The fake path - I cannot use as reference, and I don't know if I get instead
of the path the image source in bits (so I can do something like
data:image/png;base64,... a binary data ....)

Thanks

 
Reply With Quote
 
 
 
 
Ben Bacarisse
Guest
Posts: n/a
 
      01-22-2013
"Mr. X." <> writes:

> Hello.
> When I do something like this:
> <input type="file" accept="image/*" capture ></input>
>
> I can attach a picture or camera on smartphones.
>
> This all fine,
> but what if I want to show the picture to the user who choose it.
> I created for that a <div> element and try to set the background-image


Why use a background image?

> to the file (which is on local computer or on local smarphone) -
>
> Then I got the path of :
> c:/fakepath/myfile.jpg.
>
> How can I solve the problem?
> The fake path - I cannot use as reference, and I don't know if I get
> instead of the path the image source in bits (so I can do something
> like data:image/png;base64,... a binary data ....)


Yes, many browsers support these data pseudo-URLs in the src attribute
of an img element. I have not used them is CSS, but I think support is
limited.

--
Ben.
 
Reply With Quote
 
 
 
 
Mr. X.
Guest
Posts: n/a
 
      01-22-2013
Found:
http://saravani.wordpress.com/2012/0...t-is-uploaded/
That's solved my problem.

BTW - As the above problem - how can I know also which width+height are
related to the image?

Thanks, anyway.

"Ben Bacarisse" wrote in message
news:0.9eb5b06b2d846a60dad8.20130122205013GMT.87vc ...

"Mr. X." <> writes:

> Hello.
> When I do something like this:
> <input type="file" accept="image/*" capture ></input>
>
> I can attach a picture or camera on smartphones.
>
> This all fine,
> but what if I want to show the picture to the user who choose it.
> I created for that a <div> element and try to set the background-image


Why use a background image?

> to the file (which is on local computer or on local smarphone) -
>
> Then I got the path of :
> c:/fakepath/myfile.jpg.
>
> How can I solve the problem?
> The fake path - I cannot use as reference, and I don't know if I get
> instead of the path the image source in bits (so I can do something
> like data:image/png;base64,... a binary data ....)


Yes, many browsers support these data pseudo-URLs in the src attribute
of an img element. I have not used them is CSS, but I think support is
limited.

--
Ben.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Faked Photos Online Canuckster Digital Photography 0 01-26-2009 12:31 AM
IDF faked photo ? febo@delenda.net Digital Photography 11 08-17-2006 09:25 PM
faked? hame1957@bluemail.ch Digital Photography 93 02-01-2005 09:39 PM
ANN: fauxident 1.2.1 -- A simple, faked ident daemon Erik Max Francis Python 0 10-22-2003 03:15 AM
ANN: fauxident 1.2 -- A simple, faked ident daemon Erik Max Francis Python 0 09-27-2003 10:15 PM



Advertisments