moose-en-a-gant Posted January 11, 2015 Share Posted January 11, 2015 I don't know, it seemed simple but it turns out I don't know what to do. I was told that storing a photo as a blob was much harder than simply storing a photo's url or directory location... So... when a file has been selected through the browse-file manager triggered by <input type="file"...> and the file selected is shown, when a person pusehs "upload" what is supposed to happen? Do I need some kind of FTP client to access the server and place the photo in there? It seems so easy in a way like the built in filemanager in cPanel... What am I missing? Thanks for any help. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted January 11, 2015 Share Posted January 11, 2015 The php manual is a resource that you should get used to relying on. If you had simply done a search for file uploading in it you would have found this: http://php.net/manual/en/features.file-upload.post-method.php Have at it. Quote Link to comment Share on other sites More sharing options...
moose-en-a-gant Posted January 11, 2015 Author Share Posted January 11, 2015 Okay thank you, I will do that. Thanks for the link. Quote Link to comment Share on other sites More sharing options...
moose-en-a-gant Posted January 11, 2015 Author Share Posted January 11, 2015 Sorry to mark this as unsolved, I had a question Is there such a thing as parmeter binding for file upload? I would presume not since it is directly done through a file manager and a file can hold theoretically anything... but it is a file eg. not an injection threat... but I'm not sure, can someone shed some light on that? Quote Link to comment Share on other sites More sharing options...
ginerjm Posted January 12, 2015 Share Posted January 12, 2015 Did you read the manual section that I gave you? Quote Link to comment Share on other sites More sharing options...
moose-en-a-gant Posted January 12, 2015 Author Share Posted January 12, 2015 (edited) I loked at it, I'm going to use the second example Edited January 12, 2015 by moose-en-a-gant Quote Link to comment Share on other sites More sharing options...
ginerjm Posted January 12, 2015 Share Posted January 12, 2015 Then stop digressing and move forward with that. Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted January 12, 2015 Share Posted January 12, 2015 You should not use the example code. It demonstrates the basic features, but it's not appropriate in a production environment with real data and real threats. For example, the script lets anybody place malicious PHP scripts on the server. That's obviously not acceptable. So once you understand the basics of file uploads, you need to deal with security. Check out this article about typical vulnerabilities and how to fix them. 1 Quote Link to comment Share on other sites More sharing options...
moose-en-a-gant Posted January 12, 2015 Author Share Posted January 12, 2015 Thanks for that information Jacques 1 I'm curious what your avatar is. Quote Link to comment Share on other sites More sharing options...
moose-en-a-gant Posted January 13, 2015 Author Share Posted January 13, 2015 (edited) I'm going to ask a question that I may solve later today. I want to trigger the file upload by a photo rather than the stock browse button / submit button... which results from <input type="file"... I think I know how to do this, I've been taught how to use different post steps depending on the value eg. $action I just don't want the browse button nor the submit button to show... I may have to settle with a pop up window or something... otherwise hide the buttons somehow, once the pop-up or file manager has occured, then a button appears to submit after seeing which photo was selected. I'm not sure how I will display a photo in a text area, I may need to come up with a new 'canvas' that supports different things eg. text, embedded video, image Edited January 13, 2015 by moose-en-a-gant Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.