NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: olu on April 12, 2011, 12:51:05 PM
-
hello please can anyone help trying to make it possible for a user to upload a file but get it resize before saving it in a folder on the system
-
I'm not sure what you mean.
How do you resize a file?
Cheers
Bruce
-
Unfortunately on the web, unless you use some client side code (java app or clarion app) you'll have to let the client upload the larger file and then resize at the server.
You'll need a library that can resize images (Like ImageEx or LeadTools).
On the form that contains the image. Add code into the POSTUPDATE.Start embed.
The image should be in the upload folder at this time, grab it resize it and put it in the right place.
I also have code in the RenameFile embed point (in the WebServerHandler procedure) to name the incoming files in a way i like.
Regards
Bill
-
ahh - resizing _image_ files... that makes sense.
see also http://www.clarionfreeimage.com/ (http://www.clarionfreeimage.com/)
-
thanks that almost work using clarionfreeimage to resize the images but my problem now is capturing the file uploaded name , i can make it work if i have a pre-defined names but the names of the files are going to be random and i will have to upload four diffrent image file upto the form.so need to get each file and then resize them has they are uploaded.
-
The filename should be in the value of the field you used for the file upload.
-
Thanks guys that worked. Got it to resize the file and renamed it but got just one little problem to go.
Now that i have created my new file how do i update the filed path name and file name to point to my new filename and not still holding my old copied file, try to rename it at renamefile procedure but the problem with this is that it renames the file to the new name before i can use clarionfreeimage to resize the image file.
-
Has anyone got something like this to work?
I want my user to be able to:
1. Upload an image..could be BM,JPG,PNG,etc..
2. Once the file is uploaded into the uploads directory,
resize the image file on the disk =< 50k
Thanks,
Don
-
Hey Folks,
The way I've worked this is:
- upload image
- extract image name
- copy image from uploads path to custom path
- create the various image sizes needed (eg HiRes - which is usually the one uploaded, LowRes, Thumb)
- this is done using Draw + FreeImage
- update the record fields (HiresPath, Lowres_Path, Thumb_Path)
Works pretty well. The system deals with a lot of images and this paradigm has been in place for a year now, hasn't skipped a beat.
-
Okay Stu, this part:
- create the various image sizes needed (eg HiRes - which is usually the one uploaded, LowRes, Thumb)
- this is done using Draw + FreeImage
Can you get me pointed in the right direction as to how to do this?
Thanks!
Don
-
Hey Stu,
With a great deal of help from Larry Sand....I have it working now.
Thank you my friend!
Don
-
Great to hear you got it working Don. Apologies for not getting back on the forum till (my) monday morning. My weekends are full of Family and Church stuff :)
-
It turned out to be pretty darn simple. What I'm doing is simple but I just didn't have a clue how to do it.
I'm going to zip up the example app and provide here in the Share Knowledge section.
Very understandable you being busy Stu.
Don
-
I have been doing this for some time, using the ImageEx system (v.2). Recently, I changed how I am doing it though. I'm now using a separate program to do the image processing in a queue because I found it was bogging down the system to have multiple instances of ImageEx running on a larger scale system with multiple clients hammering away with image uploads.
-
Mike,
Care to share what program you are using for the images?
Thanks,
Dave Pederson
-
Dave, so sorry, I didn't see your response. The program is simply one written in Clarion. I've been using the value utilities for a lot of pre-made components.